ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

13 lines
462 B

  1. class CreateTheatreWatchingUsers < ActiveRecord::Migration[8.0]
  2. def change
  3. create_table :theatre_watching_users, primary_key: [:theatre_id, :user_id] do |t|
  4. t.references :theatre, null: false, foreign_key: { to_table: :theatres }
  5. t.references :user, null: false, foreign_key: { to_table: :users }, index: true
  6. t.datetime :expires_at, null: false, index: true
  7. t.timestamps
  8. t.index [:theatre_id, :expires_at]
  9. end
  10. end
  11. end