about summary refs log tree commit diff
path: root/db/migrate/20190724173350_remove_chat.rb
blob: 8425d06dde15a246dc7b2967dfc41a135fff5872 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class RemoveChat < ActiveRecord::Migration[5.2]
  def up
    Status.where(visibility: 6).find_each &:destroy
    remove_index :statuses, name: "index_statuses_on_account_id_and_id_and_visibility"
    safety_assured {
      remove_column :accounts, :supports_chat
      remove_column :tags, :chat
      drop_table :chat_accounts
    }
  end

  def down
    raise ActiveRecord::IrreversibleMigration
  end
end