mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 04:03:57 -06:00
6b9dd22ba7
Followup to f3402be262
, adds
the new helper to two other core migrations that need it.
17 lines
488 B
Ruby
17 lines
488 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DisableAllowUncategorizedNewSites < ActiveRecord::Migration[7.0]
|
|
def up
|
|
# keep allow uncategorized for existing sites
|
|
execute <<~SQL if Migration::Helpers.existing_site?
|
|
INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
|
|
VALUES('allow_uncategorized_topics', 5, 't', NOW(), NOW())
|
|
ON CONFLICT (name) DO NOTHING
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|