fix(db): default cad_parcels.source in trigger (on-demand ingest) #1043

Merged
bot-backend merged 1 commit from fix/cad-parcels-source-default into main 2026-06-04 07:49:53 +00:00
Collaborator

Continuation of #129 (on-demand ingest 500). After #129 derived quarter_cad_number, the cad_parcels INSERT hit the NEXT NOT NULL column: source (NotNullViolation) -> geometry tx rolled back -> /analyze still stuck. Repro 66:41:0610029:83 (job 57).

Migration 130: extend the #129 trigger to also default source->'nspd' when NULL (column DEFAULT can't help — INSERT binds explicit NULL; trigger overrides). Explicit sources respected. cad_parcels NOT NULL surface now fully covered. Dry-run-verified on prod.

Continuation of #129 (on-demand ingest 500). After #129 derived quarter_cad_number, the cad_parcels INSERT hit the NEXT NOT NULL column: source (NotNullViolation) -> geometry tx rolled back -> /analyze still stuck. Repro 66:41:0610029:83 (job 57). Migration 130: extend the #129 trigger to also default source->'nspd' when NULL (column DEFAULT can't help — INSERT binds explicit NULL; trigger overrides). Explicit sources respected. cad_parcels NOT NULL surface now fully covered. Dry-run-verified on prod.
bot-backend added 1 commit 2026-06-04 07:49:49 +00:00
fix(db): default cad_parcels.source in trigger (on-demand ingest 2nd NOT NULL gap)
Some checks failed
Deploy / build-worker (push) Successful in 39s
Deploy / deploy (push) Has been cancelled
Deploy / changes (push) Successful in 6s
Deploy / build-frontend (push) Has been skipped
Deploy / build-backend (push) Successful in 36s
51966b38c8
After #129 fixed quarter_cad_number, the on-demand НСПД ingest of a real
not-pre-loaded parcel hit the NEXT cad_parcels NOT NULL column: source
(NotNullViolation) → geometry transaction rolled back → POST /analyze still
stuck. Repro 66:41:0610029:83 (job 57: quarter derived by #129, source null).

Migration 130: extend the #129 BEFORE INSERT/UPDATE trigger function to also
default source→'nspd' when NULL (column DEFAULT can't help — INSERT binds
explicit NULL; trigger overrides it). Explicit sources ("search"/"wms_grid_walk")
respected — only NULL is filled. cad_parcels NOT NULL surface now fully covered
(cad_num/quarter[#129]/category_id[literal]/source[#130]/fetched_at+updated_at[NOW]).
Dry-run-verified on prod: null quarter+source → 66:41:0610029 + nspd, INSERT ok.
bot-backend merged commit 51966b38c8 into main 2026-06-04 07:49:53 +00:00
bot-backend deleted branch fix/cad-parcels-source-default 2026-06-04 07:49:53 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1043
No description provided.