mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 19:22:18 +08:00
As with rows, database sequence values are not persisted in
`structure.sql`. This commit adds a new check which detects any sequence
values introduced by migrations, and throws an error.
Existing issues are fixes up:
1. `enable_bookmarks_with_reminders` was being inserted and removed from
site settings unnecessarily. Removed.
2. user_associated_accounts and data_explorer_queries were having their
sequences updated unnecessarily on empty databases. Updated them to be
conditional.
3. Groups PK had been modified in a couple of different ways. A new
migration normalizes the start & current values to `40`, matching the
current behaviour
4. Badges PK was intended to START_AT 100. However, seed_fu/activerecord
were resetting the sequence to a lower number than that. A before_save
hook on the model already exists to work around that problem. Added a
migration to reset the sequence STARTS AT to 1, to make it clear that it
has no effect and we're relying on the model layer.
5. Flags PK STARTS_AT was already fixed in
`
|
||
|---|---|---|
| .. | ||
| 20200810053843_create_data_explorer_queries.rb | ||
| 20200902225712_fix_query_ids.rb | ||
| 20230227102505_rename_data_explorer_namespace.rb | ||
| 20241009161603_alter_query_id_to_bigint.rb | ||
| 20260316071737_rename_data_explorer_api_key_scope_resource.rb | ||