about summary refs log tree commit diff
path: root/db/migrate/20190724173350_remove_chat.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20190724173350_remove_chat.rb')
-rw-r--r--db/migrate/20190724173350_remove_chat.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20190724173350_remove_chat.rb b/db/migrate/20190724173350_remove_chat.rb
new file mode 100644
index 000000000..8425d06dd
--- /dev/null
+++ b/db/migrate/20190724173350_remove_chat.rb
@@ -0,0 +1,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