mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:56:01 +08:00
3593e582a3
* FIX - limit number of embedded media items in a post * Add renamed settings to DeprecatedSettings
20 lines
1.1 KiB
Ruby
20 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
class RenamePostImageSiteSettings < ActiveRecord::Migration[6.0]
|
|
def up
|
|
execute "UPDATE site_settings SET name = 'newuser_max_embedded_media' WHERE name = 'newuser_max_images'"
|
|
execute "UPDATE user_histories SET subject = 'newuser_max_embedded_media' WHERE subject = 'newuser_max_images'"
|
|
|
|
execute "UPDATE site_settings SET name = 'min_trust_to_post_embedded_media' WHERE name = 'min_trust_to_post_images'"
|
|
execute "UPDATE user_histories SET subject = 'min_trust_to_post_embedded_media' WHERE subject = 'min_trust_to_post_images'"
|
|
end
|
|
|
|
def down
|
|
execute "UPDATE site_settings SET name = 'newuser_max_images' WHERE name = 'newuser_max_embedded_media'"
|
|
execute "UPDATE user_histories SET subject = 'newuser_max_images' WHERE subject = 'newuser_max_embedded_media'"
|
|
|
|
execute "UPDATE site_settings SET name = 'min_trust_to_post_images' WHERE name = 'min_trust_to_post_embedded_media'"
|
|
execute "UPDATE user_histories SET subject = 'min_trust_to_post_images' WHERE subject = 'min_trust_to_post_embedded_media'"
|
|
end
|
|
end
|