Uploaded image for project: 'Instrument control development'
  1. Instrument control development
  2. INSTRM-2015

Change the foreign key constraint of `cobra_move` and `cobra_match`

    XMLWordPrintable

    Details

      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`.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiyoto.yabe Kiyoto Yabe
                Reporter:
                kiyoto.yabe Kiyoto Yabe
                Reviewers:
                chyan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: