fedibird-fe/db/migrate/20220226153842_create_status_references.rb

12 lines
426 B
Ruby
Raw Permalink Normal View History

2022-03-17 14:25:16 +00:00
class CreateStatusReferences < ActiveRecord::Migration[6.1]
def change
create_table :status_references do |t|
t.references :status, null: false, foreign_key: { on_delete: :cascade }, index: false
t.references :target_status, null: false, foreign_key: { on_delete: :cascade, to_table: :statuses }, index: false
t.index [:status_id, :target_status_id], unique: true
t.timestamps
end
end
end