20220124141035_create_appeals.rb 628 B

1234567891011121314
  1. class CreateAppeals < ActiveRecord::Migration[6.1]
  2. def change
  3. create_table :appeals do |t|
  4. t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }
  5. t.belongs_to :account_warning, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
  6. t.text :text, null: false, default: ''
  7. t.datetime :approved_at
  8. t.belongs_to :approved_by_account, foreign_key: { to_table: :accounts, on_delete: :nullify }
  9. t.datetime :rejected_at
  10. t.belongs_to :rejected_by_account, foreign_key: { to_table: :accounts, on_delete: :nullify }
  11. t.timestamps
  12. end
  13. end
  14. end