mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Migrate post_edit_time_limit to tl2_post_edit_time_limit (#8082)
If a user amended edit_time_limit keep the behavior as is, instead of introducing a potentially tighter time for tl2 edit time than what they had set in the past.
This commit is contained in:
parent
800e49f16e
commit
d17425cbb8
26
db/migrate/20190908234054_migrate_post_edit_time_limit.rb
Normal file
26
db/migrate/20190908234054_migrate_post_edit_time_limit.rb
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class MigratePostEditTimeLimit < ActiveRecord::Migration[5.2]
|
||||||
|
def up
|
||||||
|
execute <<~SQL
|
||||||
|
INSERT INTO site_settings (
|
||||||
|
name,
|
||||||
|
value,
|
||||||
|
data_type,
|
||||||
|
created_at,
|
||||||
|
updated_at
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
'tl2_post_edit_time_limit',
|
||||||
|
value,
|
||||||
|
data_type,
|
||||||
|
CURRENT_TIMESTAMP,
|
||||||
|
CURRENT_TIMESTAMP
|
||||||
|
FROM site_settings
|
||||||
|
WHERE
|
||||||
|
name = 'post_edit_time_limit'
|
||||||
|
ON CONFLICT
|
||||||
|
DO NOTHING
|
||||||
|
SQL
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user