Repository navigation
Conversation
Migration c4e8a1b27f09 assumed restricted_condition_cnd_id_seq and restricted_word_word_id_seq exist. They do in dev/test/prod, but the migration history never creates them, so a fresh database (CI, local) fails and every api unit test errors in setup. Create each sequence only when missing and set it past the current max id.
panish16
requested review from
davemck513,
mengdong19,
ozamani9gh and
stevenc987
as code owners
November 27, 2026 00:16
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issue #, if available: follow-up to #2050 / #2051 (#31439)
Description of changes:
api unit-testing has been red on main since #2050. Every test errors in setup with
relation "restricted_condition_cnd_id_seq" does not exist(373 errors, 0 run), so no api PR gets a real test signal right now (e.g. #2052).Cause: migration
c4e8a1b27f09setsnextval('restricted_condition_cnd_id_seq')/restricted_word_word_id_seqas column defaults, but nothing in the migration history creates those sequences (the 2018add_restricted_word_tablesrevision only maderestricted_condition_id). They exist in the real dbs, so dev migrated fine, but a fresh db (CI, local) blows up.Fix: before repairing each id column, create the sequence only if it's missing and
setvalit past the current max id. Same pattern4c33aac6da67/472b3fcc1288already use.Testing:
472b3fcc1288, both sequences createdBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).