mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 14:24:27 +08:00
19 lines
450 B
Ruby
19 lines
450 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateReadPosts < ActiveRecord::Migration[4.2]
|
|
def up
|
|
create_table :read_posts, id: false do |t|
|
|
t.integer :forum_thread_id, null: false
|
|
t.integer :user_id, null: false
|
|
t.column :page, :integer, null: false
|
|
t.column :seen, :integer, null: false
|
|
end
|
|
|
|
add_index :read_posts, %i[forum_thread_id user_id page], unique: true
|
|
end
|
|
|
|
def down
|
|
drop_table :read_posts
|
|
end
|
|
end
|