compbiocore / qcdb

QC Database
0 stars 1 forks source link

unique constraint for metrics does not work if `read_type=NULL` #33

Open aguang opened 4 years ago

aguang commented 4 years ago

Our current unique constraint for the metrics table is: UniqueConstraint('db_id', 'qc_program', 'qc_metric', 'read_type')). However, we've been leaving read_type=NULL for programs like picardTools which do not require read type information. As NULL != NULL, this leads to multiple inserts being allowed for picardTools as long as db_id, qc_program, qc_metric is the same which is behavior we don't want. To address this, we can have read_type = -1 in cases like picardTools so that the unique constraint will still hold.