8cf7107445
#295 #295 #295 #295 #295 #295 #295 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #296
13 lines
462 B
Ruby
13 lines
462 B
Ruby
class CreateTheatreWatchingUsers < ActiveRecord::Migration[8.0]
|
|
def change
|
|
create_table :theatre_watching_users, primary_key: [:theatre_id, :user_id] do |t|
|
|
t.references :theatre, null: false, foreign_key: { to_table: :theatres }
|
|
t.references :user, null: false, foreign_key: { to_table: :users }, index: true
|
|
t.datetime :expires_at, null: false, index: true
|
|
t.timestamps
|
|
|
|
t.index [:theatre_id, :expires_at]
|
|
end
|
|
end
|
|
end
|