FEATURE: Groundwork for user-selectable theme components

* Phase 0 for user-selectable theme components

- Drops `key` column from the `themes` table
- Drops `theme_key` column from the `user_options` table
- Adds `theme_ids` (array of ints default []) column to the `user_options` table and migrates data from `theme_key` to the new column.
- Removes the `default_theme_key` site setting and adds `default_theme_id` instead.
- Replaces `theme_key` cookie with a new one called `theme_ids`
- no longer need Theme.settings_for_client
This commit is contained in:
OsamaSayegh
2018-07-12 07:18:21 +03:00
committed by Sam
parent f13a7226db
commit decf1f27cf
45 changed files with 289 additions and 241 deletions

View File

@@ -217,4 +217,26 @@ Migration::TableDropper.delayed_drop(
}
)
Migration::ColumnDropper.drop(
table: 'user_options',
after_migration: 'DropKeyColumnFromThemes',
columns: %w[
theme_key
],
on_drop: ->() {
STDERR.puts 'Removing theme_key column from user_options table!'
}
)
Migration::ColumnDropper.drop(
table: 'themes',
after_migration: 'DropKeyColumnFromThemes',
columns: %w[
key
],
on_drop: ->() {
STDERR.puts 'Removing key column from themes table!'
}
)
Discourse.reset_active_record_cache