DEV: Promote historic post_deploy migrations for core plugins. (#30987)

This commit promotes all post_deploy migrations which existed in
Discourse v3.3.0 (timestamp <= 20240717053710)
This commit is contained in:
Roman Rizzi
2025-01-24 11:47:03 -03:00
committed by GitHub
parent 42fb6c9822
commit a1bbbbda02
11 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# frozen_string_literal: true
class FillStyleguideAdminOnlyGroups < ActiveRecord::Migration[7.0]
def up
old_setting =
DB.query_single(
"SELECT value FROM site_settings WHERE name = 'styleguide_admin_only' LIMIT 1",
).first
if old_setting.present?
allowed_groups = old_setting == "t" ? "1" : "14" # use admins AUTO_GROUP if true, otherwise default to TL4
DB.exec(
"INSERT INTO site_settings(name, value, data_type, created_at, updated_at)
VALUES('styleguide_allowed_groups', :setting, '20', NOW(), NOW())",
setting: allowed_groups,
)
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end