From eec738710b4963e595c3128ec49cb276e675e6f2 Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Tue, 9 Nov 2021 10:38:17 -0600 Subject: [PATCH] Rerun migrate themes script (#15312) Because of the way the the scripts to run works, there's always already a script with this file name by the time this starts. Remove the guard clause and let it run. --- .../20211109161231_migrate_themes_again.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/data_update_scripts/20211109161231_migrate_themes_again.rb diff --git a/lib/data_update_scripts/20211109161231_migrate_themes_again.rb b/lib/data_update_scripts/20211109161231_migrate_themes_again.rb new file mode 100644 index 000000000..f42a4134b --- /dev/null +++ b/lib/data_update_scripts/20211109161231_migrate_themes_again.rb @@ -0,0 +1,25 @@ +module DataUpdateScripts + class MigrateThemesAgain + def run + # No OS sync for Dark (2) users + Users::Setting + .where(config_theme: 2) + .update_all(prefer_os_color_scheme: false) + + # Ten X Hacker (4) -> Dark (2), no OS sync + Users::Setting + .where(config_theme: 4) + .update_all(config_theme: 2, prefer_os_color_scheme: false) + + # Minimal (1) -> Light (0), no OS sync + Users::Setting + .where(config_theme: 1) + .update_all(config_theme: 0, prefer_os_color_scheme: false) + + # Pink (3) -> Light (0), OS sync (defaults to true), the + Users::Setting + .where(config_theme: 3) + .update_all(config_theme: 0) + end + end +end