2022-12-13 19:25:19 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class EnableSidebarAndChat < ActiveRecord::Migration[7.0]
|
|
|
|
def up
|
2023-04-03 06:46:39 -04:00
|
|
|
# keep sidebar legacy and chat disabled for existing sites
|
|
|
|
if Migration::Helpers.existing_site?
|
2022-12-13 19:25:19 -05:00
|
|
|
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
|