20181213184704_create_account_warnings.rb 407 B

123456789101112
  1. class CreateAccountWarnings < ActiveRecord::Migration[5.2]
  2. def change
  3. create_table :account_warnings do |t|
  4. t.belongs_to :account, foreign_key: { on_delete: :nullify }
  5. t.belongs_to :target_account, foreign_key: { to_table: 'accounts', on_delete: :cascade }
  6. t.integer :action, null: false, default: 0
  7. t.text :text, null: false, default: ''
  8. t.timestamps
  9. end
  10. end
  11. end