Fix incorrect data type for `SiteSetting.google_oauth2_prompt`.

This commit is contained in:
Guo Xiang Tan 2018-02-23 12:17:04 +08:00
parent ea1733ca64
commit 4ac5fc8cd3
1 changed files with 16 additions and 0 deletions

View File

@ -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