You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is almost certainly wrong; it should be quality_version not quality_comment.
Fixing this should be as simple as changing CreateDB.py. We then should also have a script for updating existing databases with the old constraint; it will need to check if there are existing violations of the new constraint, and then change the constraint.
Closure condition
This issue should be closed when there is agreement on this change and the script to update old databases is merged.
Ahh sure ok, why this never made an issue is that sqlite does not enforce constraints itself so I think the database I created above would have no information on the constraint. Likely just update and move on. Would likely play hell with postgres.
Run that SQL....sqlite is definitely storing the constraint, although it might not be enforcing (I'm not seeing anything to indicate it never does/can't.) I haven't put anything in to intentionally try and violate the constraint.
"For the purposes of UNIQUE constraints, NULL values are considered distinct from all other values, including other NULLs"...since our quality_comment is usually NULL, this essentially makes the constraint meaningless. docs
Activity
balarsen commentedon Sep 15, 2020
At least in my old hope database the database is correct
balarsen commentedon Sep 15, 2020
A better test is that a freshly made table is also correct
jtniehof commentedon Sep 15, 2020
Neither of what you have posted includes the constraint; the second is the code table, and this only applies to the file table.
jtniehof commentedon Sep 15, 2020
The problem is the
CONSTRAINT "Unique file tuple"at the very end.balarsen commentedon Sep 15, 2020
Ahh sure ok, why this never made an issue is that sqlite does not enforce constraints itself so I think the database I created above would have no information on the constraint. Likely just update and move on. Would likely play hell with postgres.
Or at least did not... dunno about more modern.
jtniehof commentedon Sep 15, 2020
Run that SQL....sqlite is definitely storing the constraint, although it might not be enforcing (I'm not seeing anything to indicate it never does/can't.) I haven't put anything in to intentionally try and violate the constraint.
"For the purposes of UNIQUE constraints, NULL values are considered distinct from all other values, including other NULLs"...since our
quality_commentis usually NULL, this essentially makes the constraint meaningless. docsbalarsen commentedon Sep 15, 2020
OK, I agree. There is the constraint.
That NULL is an insidious feature.