2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-17 12:25:13 -04:00
|
|
|
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
|