FIX: set default on theme.key, if it has not yet been dropped (#6095)

This commit is contained in:
David Taylor 2018-07-16 23:40:35 +01:00 committed by Sam
parent 331296e851
commit f4c902b434

View File

@ -0,0 +1,11 @@
class AddThemeKeyDefault < ActiveRecord::Migration[5.2]
def up
if column_exists?(:themes, :key)
execute("ALTER TABLE themes ALTER COLUMN key SET DEFAULT 'deprecated'")
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end