discourse/plugins/discourse-assign/config
David Taylor 2392ff95cd
DEV: Skip backfill INSERTs in old migrations on fresh installs (#39976)
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.
2026-05-13 13:59:28 +01:00
..
locales I18N: Update translations (#39747) 2026-05-05 18:53:54 +02:00
routes.rb DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
settings.yml DEV: Skip backfill INSERTs in old migrations on fresh installs (#39976) 2026-05-13 13:59:28 +01:00