foreign_key, non-nullable, dependent: destroy in account_moderation_notes (#5294)
* Add foreign key constraint to column `account` in `account_moderation_notes` * Change account_id and target_account_id to non-nullable in account_moderation_notes * Add dependent: :destroy to account and target_account in account_moderation_notesmaster
parent
96c942e8ab
commit
6c54d2e583
@ -0,0 +1,5 @@ |
||||
class AddForeignKeyToAccountModerationNotes < ActiveRecord::Migration[5.1] |
||||
def change |
||||
add_foreign_key :account_moderation_notes, :accounts |
||||
end |
||||
end |
@ -0,0 +1,6 @@ |
||||
class ChangeAccountsNonnullableInAccountModerationNotes < ActiveRecord::Migration[5.1] |
||||
def change |
||||
change_column_null :account_moderation_notes, :account_id, false |
||||
change_column_null :account_moderation_notes, :target_account_id, false |
||||
end |
||||
end |
Loading…
Reference in new issue