discourse/db/migrate/20260603115200_create_admin_dashboard_sections.rb
Natalie Tay 8d43a7c5d7
DEV: Persist dashboard configuration in table and *not* on closure of the dialog (#40546)
The configuration used to be saved as a pipe-separated value in site
settings, with only the enabled ones. This meant there would be no order
kept if something is disabled as they were simply omitted from the site
setting.

This commit moves us to a DB table to save the settings so order can be
kept. Also, the change is committed immediately now instead of on
closure of the modal. It is also smart about not refreshing when
toggling "off" or rearranging.
2026-06-04 10:53:59 +08:00

13 lines
396 B
Ruby
Vendored

# frozen_string_literal: true
class CreateAdminDashboardSections < ActiveRecord::Migration[8.0]
def change
create_table :admin_dashboard_sections do |t|
t.string :section_id, null: false
t.integer :position, null: false
t.boolean :visible, null: false, default: true
t.timestamps
end
add_index :admin_dashboard_sections, :section_id, unique: true
end
end