Skip to content

[WV-5202] ERROR: null value in column "id" of relation "candidate_candidatecampaign" violates not-null constraint in Local Server only [TEAM REVIEW] - #3307

Merged
DaleMcGrew merged 1 commit into
wevote:developfrom
pravingv:WV_5202_Candidate_Create_SQL_error
Oct 13, 2026
Merged

DaleMcGrew merged 1 commit into
wevote:developfrom
pravingv:WV_5202_Candidate_Create_SQL_error

Conversation

@pravingv

@pravingv pravingv commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What github.com/wevote/WebApp/issues does this fix?
WV-5202 ERROR: null value in column "id" of relation "candidate_candidatecampaign" violates not-null constraint in Local Server only

Changes included this pull request?
retrieve_tables/controllers_local.py

  • Check whether the table contains an id column.
  • Ensure the _id_seq sequence exists and is configured as the column's default using DEFAULT nextval(...).
  • Set the sequence value to MAX(id) + 1 to prevent primary key conflicts when inserting new rows after restoring data..
  • retrieve_tables/controllers_master.py

    • Update the pg_dump configuration to include the corresponding sequence, if present, along with the table data by using a wildcard pattern or explicitly including both objects.

@DaleMcGrew

Copy link
Copy Markdown
Member

👍 Thank you @pravingv

@DaleMcGrew
DaleMcGrew merged commit f97d57b into wevote:develop Oct 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants