1
0

20220124141035_create_appeals.rb 659 B

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