DEV: Remove chat related migration (#23449)

What motivated this change?

A core migration contains chat related code and this should not be the
case since chat related migration code should live in the chat plugin.

What does this change do?

This change removes the migration which was introduced to keep existing
sites on the legacy navigation menu as well as keep chat disabled when
the defaults for the `navigation_menu` and `chat_enabled` site settings
were flipped. Since this migration doesn't apply to new sites and
the migration has already been introduced for 9 months, it is safe for
us to remove it.
This commit is contained in:
Alan Guo Xiang Tan 2023-09-08 12:41:56 +08:00 committed by GitHub
parent dc76d82f24
commit 26dfb8a489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 23 deletions

View File

@ -1,23 +0,0 @@
# frozen_string_literal: true
class EnableSidebarAndChat < ActiveRecord::Migration[7.0]
def up
# keep sidebar legacy and chat disabled for existing sites
if Migration::Helpers.existing_site?
execute <<~SQL
INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
VALUES('chat_enabled', 5, 'f', NOW(), NOW())
ON CONFLICT (name) DO NOTHING
SQL
execute <<~SQL
INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
VALUES('navigation_menu', 7, 'legacy', NOW(), NOW())
ON CONFLICT (name) DO NOTHING
SQL
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end