You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
816 B

  1. class CreateBlockMutes < ActiveRecord::Migration[5.0]
  2. def change
  3. create_table "block_mutes", force: :casecade do |t|
  4. t.integer "account_id", null: false
  5. t.integer "target_account_id", null: false
  6. t.boolean "block", null: false
  7. t.datetime "created_at", null: false
  8. t.datetime "updated_at", null: false
  9. end
  10. add_column :blocks, :block, :boolean, null: false
  11. execute "ALTER TABLE blocks ADD CONSTRAINT check_mutes_on_block CHECK(block = TRUE), INHERIT block_mutes"
  12. Block.update_all block: true
  13. add_column :mutes, :block, :boolean, null: false
  14. execute "ALTER TABLE mutes ADD CONSTRAINT check_mutes_on_block CHECK(block = FALSE), INHERIT block_mutes"
  15. Mute.update_all block: false
  16. end
  17. end