Crystal_planes is not allowing records with same id/timestamp but different plane field.
I am working on the upload of metrology measurements for crystals. When uploading crystal_planes, I have an error when uploading the second bank, saying that a table for the same crystal_id and test_date already exists (see below). We have 6 crystal_planes tables for each set of measurements, identified by a different variable 'plane'.
I tried to upload only the second bank and it works. Maybe the check on the plane variable is missing.
Code is in attachment in case you need it.
<mu2egpvm01.fnal.gov> python load_cmm.py Input data for crystal_metrology_measurements table:
['C0044', '12/8/2016', '16:12', 'unknown', 'FNAL', 'wk-ediociaiuti01', 'small scratch on bottom face(A11820)', ''] Table crystal_metrology_measurements for crystal C0044 successfully ulpoaded
1 records inserted or updated
Table crystal_planes for crystal C0044 successfully ulpoaded rear
Failure in uploading crystal_planes table for crystal C0044
400 Bad Request
Postgresql exception on row 0
duplicate key value violates unique constraint "pk_crystal_planes_0"
DETAIL: Key (crystal_id, test_date)=(C0044, 2016-12-08 00:00:00-06) already exists.