Closed Schaechtle closed 6 years ago
One can have 2 populations that both have generator_id 1 and table_rowid 1, thus the first
UNIQUE
is incorrect.
That does not sound right, since the generator_id
is unique, so it cannot be shared by two populations.
I believe it is the final constraint UNIQUE(table_rowid, loom_rowid)
that needs to be removed, since it disallows the following (perfectly legal) table:
| generator_id | table_rowid | loom_rowid |
| ------------- |:-------------:| -----------:|
| 1 | 1 | 1 |
| 2 | 1 | 1 |
correct. I misread my own edits to the code. Sorry about that. If applied to the correct uniqueness constraint the fix works.
The following table (find it here) makes incorrect assumptions regarding uniqueness:
One can have 2 populations that both have
generator_id
1 andtable_rowid
1, thus the firstUNIQUE
is incorrect.Suggested fix: remove uniqueness constraint and update PRIMARY KEY to be:
and adjust the
FOREIGN KEY
inbayesdb_loom_row_kind_partition
accordingly.