2017-05-03 11:31:16 -04:00
|
|
|
# we can not guess what to do if customization already started, so skip it
|
|
|
|
if !Theme.exists?
|
|
|
|
STDERR.puts "> Seeding dark and light themes"
|
|
|
|
|
|
|
|
name = I18n.t("wizard.step.colors.fields.theme_id.choices.dark.label")
|
2017-05-03 11:44:15 -04:00
|
|
|
dark_scheme = ColorScheme.find_by(base_scheme_id: "dark")
|
2017-05-03 11:31:16 -04:00
|
|
|
dark_scheme ||= ColorScheme.create_from_base(name: name, via_wizard: true, base_scheme_id: "dark")
|
|
|
|
|
|
|
|
name = I18n.t('color_schemes.dark_theme_name')
|
|
|
|
_dark_theme = Theme.create(name: name, user_id: -1,
|
|
|
|
color_scheme_id: dark_scheme.id,
|
|
|
|
user_selectable: true)
|
|
|
|
|
|
|
|
name = I18n.t('color_schemes.default_theme_name')
|
|
|
|
default_theme = Theme.create(name: name, user_id: -1,
|
|
|
|
user_selectable: true)
|
|
|
|
|
|
|
|
default_theme.set_default!
|
|
|
|
end
|
2017-05-04 10:15:32 -04:00
|
|
|
|
|
|
|
ColumnDropper.drop(
|
|
|
|
table: 'theme_fields',
|
|
|
|
after_migration: 'AddUploadIdToThemeFields',
|
|
|
|
columns: ['target'],
|
2017-05-04 13:41:05 -04:00
|
|
|
on_drop: ->(){
|
2017-05-04 10:15:32 -04:00
|
|
|
STDERR.puts 'Removing superflous theme_fields target column!'
|
|
|
|
}
|
|
|
|
)
|