mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 14:48:44 +08:00
A handful of old migrations unconditionally inserted site_settings or groups rows that fresh installs already get from YAML defaults or seed fixtures. This change gates each on `Migration::Helpers.new_site?` (or drops the redundant insert entirely) so a fresh `db:migrate` leaves no application-level rows behind: - `add_revoked_at_to_api_key.rb` no longer inserts `api_key_last_used_epoch`; `db/fixtures/990_settings.rb` now seeds it via `SiteSetting.api_key_last_used_epoch ||= Time.now`. - `fill_personal_message_enabled_groups_based_on_deprecated_settings.rb` is gated; fresh installs use the YAML default. - `ensure_anonymous_and_logged_in_users_auto_groups.rb` drops the `INSERT INTO groups (4, 5, ...)` block — `Group.ensure_automatic_groups!` in `db/fixtures/002_groups.rb` creates them. The legacy-group rename portion still runs unconditionally (no-op on fresh installs anyway). - chat `add_threads_enabled_site_setting.rb` is gated and the unconditional `SiteSetting.chat_threads_enabled = false` is replaced with a raw `INSERT ... ON CONFLICT DO NOTHING` per the migration skill. - discourse-assign `set_assign_allowed_on_groups_default.rb` is gated; the YAML `default` is bumped from `""` to `"3"` (`Group::AUTO_GROUPS[:staff]`) so fresh installs match what the migration would have written. Extracted from https://github.com/discourse/discourse/pull/39788. |
||
|---|---|---|
| .. | ||
| migrate | ||