From 4ac5fc8cd371b84947f9aa1ad32293ac3275a14e Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 23 Feb 2018 12:17:04 +0800 Subject: [PATCH] Fix incorrect data type for `SiteSetting.google_oauth2_prompt`. --- ...3041147_fix_google_oauth2_prompt_data_type.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 db/migrate/20180223041147_fix_google_oauth2_prompt_data_type.rb diff --git a/db/migrate/20180223041147_fix_google_oauth2_prompt_data_type.rb b/db/migrate/20180223041147_fix_google_oauth2_prompt_data_type.rb new file mode 100644 index 00000000000..1317ec46c4c --- /dev/null +++ b/db/migrate/20180223041147_fix_google_oauth2_prompt_data_type.rb @@ -0,0 +1,16 @@ +class FixGoogleOauth2PromptDataType < ActiveRecord::Migration[5.1] + def up + sql = <<~SQL + UPDATE site_settings + SET data_type=#{SiteSettings::TypeSupervisor.types[:list]} + WHERE data_type=#{SiteSettings::TypeSupervisor.types[:enum]} + AND name='google_oauth2_prompt' + SQL + + execute sql + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end