[INSTRM-2015] Change the foreign key constraint of `cobra_move` and `cobra_match` Created: 08/Jul/23 Updated: 21/Jul/23 Resolved: 21/Jul/23 |
|
| Status: | Done |
| Project: | Instrument control development |
| Component/s: | spt_operational_database |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Normal |
| Reporter: | Kiyoto Yabe | Assignee: | Kiyoto Yabe |
| Resolution: | Done | Votes: | 0 |
| Labels: | EngRun, opDB | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Reviewers: | chyan | ||||||||
| Description |
|
During chyan's test, there happened the following error:
2023-07-07T08:53:17.944 mcs f text="command failed: IntegrityError('(psycopg2.errors.ForeignKeyViolation) insert or update on table \"cobra_match\" violates foreign key constraint \"cobra_match_pfs_visit_id_fkey\"\nDETAIL: Key (pfs_visit_id, iteration, cobra_id)=(96418, 0, 1) is not present in table \"cobra_move\".\n') in execute_values() at /software/conda/envs/rubin3_ics/lib/python3.8/site-packages/psycopg2/extras.py:1270"
This is because the insertion sequence is `cobra_target` --> `cobra_match` --> `cobra_move`. Please change the order of foreign key constraints of `cobra_move` and `cobra_match`. |
| Comments |
| Comment by Kiyoto Yabe [ 21/Jul/23 ] |
|
Merged and tagged as 0.2.11 |