mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 01:32:41 +08:00
FIX: ChangeFullNameRequiredSetting could fail if setting was already in DB (#30605)
Followup 3187606d34
Fix full_name_requirement INSERT by adding ON CONFLICT DO NOTHING,
on sites that already have this setting this migration will fail.
This commit is contained in:
parent
51a444ab53
commit
19105bfd32
|
@ -20,11 +20,10 @@ class ChangeFullNameRequiredSetting < ActiveRecord::Migration[7.2]
|
|||
SQL
|
||||
|
||||
DB.exec(<<~SQL, value: new_setting) if new_setting
|
||||
INSERT INTO site_settings
|
||||
(name, data_type, value, created_at, updated_at)
|
||||
VALUES
|
||||
('full_name_requirement', 7, :value, NOW(), NOW())
|
||||
SQL
|
||||
INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
|
||||
VALUES ('full_name_requirement', 7, :value, NOW(), NOW())
|
||||
ON CONFLICT (name) DO NOTHING
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
Loading…
Reference in New Issue
Block a user