nas/db/migrate/20230705232953_create_status_references.rb
2023-07-06 12:55:11 +09:00

12 lines
433 B
Ruby

# frozen_string_literal: true
class CreateStatusReferences < ActiveRecord::Migration[6.1]
def change
create_table :status_references do |t|
t.belongs_to :status, null: false, foreign_key: { on_delete: :cascade }
t.belongs_to :target_status, null: false, foreign_key: { on_delete: :cascade, to_table: :statuses }
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
end
end
end