mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 12:57:17 +08:00
DEV: Introduce theme-owned color palettes (#30915)
Related to https://github.com/discourse/discourse/pull/30893 As part of the theme overhauling project, we're making each theme fully own/control its color palette which can be edited directly on the theme page. To make this possible, we need to introduce a special type of color palettes that are marked as "owned by a theme" in the database which aren't displayed in the admin color palettes page and can't be edited from it. This commit is the first step of this change; it adds a new join table to associate a color palette with a theme. For now, we're keeping the relationship one-to-one (hence the `UNIQUE` indexes), but we may later change it to one-to-many. Internal topic: t/141648.
This commit is contained in:
14
db/migrate/20250121180125_create_theme_color_scheme.rb
Normal file
14
db/migrate/20250121180125_create_theme_color_scheme.rb
Normal file
@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateThemeColorScheme < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :theme_color_schemes do |t|
|
||||
t.integer :theme_id, null: false
|
||||
t.integer :color_scheme_id, null: false
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :theme_color_schemes, :theme_id, unique: true
|
||||
add_index :theme_color_schemes, :color_scheme_id, unique: true
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user