remove chat tables & adjust status table index
parent
cefcad1130
commit
1f7a5bb57e
|
@ -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
|
|
@ -0,0 +1,6 @@
|
|||
class AddPublicIndexToStatuses < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
def change
|
||||
add_index :statuses, [:account_id, :id, :visibility], where: 'visibility IN (0, 1, 2, 4)', order: { id: :desc }, algorithm: :concurrently
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue