discourse/db/migrate/20240202032242_add_json_value_to_theme_settings.rb
Alan Guo Xiang Tan 9f884cdaab
DEV: Introduce experimental type: objects theme setting (#25538)
Why this change?

This commit introduces an experimental `type: objects` theme setting
which will allow theme developers to store a collection of objects as
JSON in the database. Currently, the feature is still in development and
this commit is simply setting up the ground work for us to introduce the
feature in smaller pieces.

What does this change do?

1. Adds a `json_value` column as `jsonb` data type to the `theme_settings` table.
2. Adds a `experimental_objects_type_for_theme_settings` site setting to
   determine whether `ThemeSetting` records of with the `objects` data
   type can be created.
3. Updates `ThemeSettingsManager` to support read/write access from the
   `ThemeSettings#json_value` column.
2024-02-08 10:20:59 +08:00

8 lines
171 B
Ruby

# frozen_string_literal: true
class AddJsonValueToThemeSettings < ActiveRecord::Migration[7.0]
def change
add_column :theme_settings, :json_value, :jsonb
end
end