discourse/db/migrate/20250718043910_add_composition_mode_user_option.rb
Martin Brennan 77211b43ee
FEATURE: Enable rich editor for all users (#33699)
We believe the rich editor is a great experience for the
vast majority of sites and users, so we are enabling it
for all sites and all users by default.

This commit does the following:

* Hides the rich_editor site setting and sets it to true by default.
  It can still be overridden by sites that want to disable it
  completely.
* Sets `rich_editor` to true for all sites to enable the rich editor
  everywhere.
* Adds a new `default_composition_mode` site setting and corresponding
user option that defaults to Rich for all users. The other option is
Markdown.
* Changes the rich editor toggle in the composer to use the new
  database-backed user option (`composition_mode`) instead of a local
  storage key/value store. This makes the preference persistent
  across devices.

Existing key/value store settings for the markdown toggle are
kept, the preference will be saved to the user option automatically.
2025-07-28 10:08:50 +10:00

6 lines
202 B
Ruby

# frozen_string_literal: true
class AddCompositionModeUserOption < ActiveRecord::Migration[7.2]
def change
add_column :user_options, :composition_mode, :integer, default: 1, null: false
end
end