mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-20 23:56:09 +08:00
The original `CreateFlags` migration bumped `flags_id_seq` to 1001 via `setval` so non-system flags get IDs >= 1001, reserving 1-999 for system flags. `pg_dump --schema-only` (which Rails uses to generate `structure.sql`) captures the sequence's `seqstart` metadata but omits runtime `setval` calls. As a result, fresh installs provisioned from `structure.sql` saw the sequence start at 1 instead of 1001. This migration uses `ALTER SEQUENCE ... START WITH` to update the sequence's metadata so the value is preserved in subsequent `structure.sql` dumps. `RESTART` is intentionally omitted: existing sites may already have `last_value` well past 1001, and rewinding would cause id collisions on the next insert. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| migrate | ||
| post_migrate | ||
| api_test_seeds.rb | ||
| structure.sql | ||