mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:59:22 -06:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
23 lines
774 B
Ruby
23 lines
774 B
Ruby
# frozen_string_literal: true
|
|
|
|
class MigrateNativeAppBannerSiteSetting < ActiveRecord::Migration[5.2]
|
|
def up
|
|
execute "INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
|
|
SELECT 'native_app_install_banner_android', 5, value, now(), now()
|
|
FROM site_settings
|
|
WHERE name = 'native_app_install_banner'"
|
|
|
|
execute "UPDATE site_settings
|
|
SET name = 'native_app_install_banner_ios'
|
|
WHERE name = 'native_app_install_banner'"
|
|
end
|
|
|
|
def down
|
|
execute "UPDATE site_settings
|
|
SET name = 'native_app_install_banner'
|
|
WHERE name = 'native_app_install_banner_ios'"
|
|
|
|
execute "DELETE FROM site_settings WHERE name = 'native_app_install_banner_android'"
|
|
end
|
|
end
|