Add db/migrate/TIMESTAMP_create_work_side_pairings.rb

This commit is contained in:
agnes 2026-11-14 07:51:47 +00:00
commit ee009b3bec

View file

@ -0,0 +1,19 @@
class CreateWorkSidePairings < ActiveRecord::Migration[7.0]
def change
create_table :work_side_pairings do |t|
t.references :work,
null: false,
type: :integer,
foreign_key: true
t.references :relationship,
null: false,
type: :integer,
foreign_key: { to_table: :tags }
t.timestamps
end
add_index :work_side_pairings,
[:work_id, :relationship_id],
unique: true,
name: "index_work_side_pairings_unique"
end
end