2017-08-31 00:06:56 -04:00
|
|
|
class CreateReadPosts < ActiveRecord::Migration[4.2]
|
2013-02-05 14:16:51 -05:00
|
|
|
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
|
|
|
|
|
2013-03-23 11:02:59 -04:00
|
|
|
add_index :read_posts, [:forum_thread_id, :user_id, :page], unique: true
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
drop_table :read_posts
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|