# HG changeset patch # User Michiel Broek # Date 1675159814 -3600 # Node ID 8a25dbe682eb4eac475bb2d504c51056dff6d7ce # Parent 94b3def5d778b0a0ca63bd3d4b8c24f2fc836d8c Added valid flag to the inventory_yeastpack table. Initial false and after record edit set to true. This should prevent the use possible wrong values. diff -r 94b3def5d778 -r 8a25dbe682eb src/EditYeastPack.cpp --- a/src/EditYeastPack.cpp Mon Jan 30 17:05:13 2023 +0100 +++ b/src/EditYeastPack.cpp Tue Jan 31 11:10:14 2023 +0100 @@ -122,11 +122,11 @@ if (this->recno == -1) { query.prepare("INSERT INTO inventory_yeastpack SET laboratory=:laboratory, form=:form, " "package=:package, notes=:notes, cells=:cells, viability=:viability, max=:max, " - "size=:size, used='0', uuid = :uuid"); + "size=:size, used='0', valid='1', uuid = :uuid"); } else { query.prepare("UPDATE inventory_yeastpack SET laboratory=:laboratory, form=:form, " "package=:package, notes=:notes, cells=:cells, viability=:viability, max=:max, " - "size=:size WHERE record = :recno"); + "size=:size, valid='1' WHERE record = :recno"); } query.bindValue(":laboratory", ui->laboratoryEdit->text()); query.bindValue(":form", ui->formEdit->currentIndex()); @@ -165,7 +165,7 @@ QSqlQuery query; query.prepare("INSERT INTO inventory_yeastpack SET laboratory=:laboratory, form=:form, " "package=:package, notes=:notes, cells=:cells, viability=:viability, max=:max, " - "size=:size, used=:used, uuid=:uuid"); + "size=:size, used=:used, valid='0', uuid=:uuid"); query.bindValue(":laboratory", ui->laboratoryEdit->text()); query.bindValue(":form", ui->formEdit->currentIndex()); query.bindValue(":package", ui->packageEdit->text() + " [copy]"); diff -r 94b3def5d778 -r 8a25dbe682eb src/MainWindow.cpp --- a/src/MainWindow.cpp Mon Jan 30 17:05:13 2023 +0100 +++ b/src/MainWindow.cpp Tue Jan 31 11:10:14 2023 +0100 @@ -186,6 +186,7 @@ "`max` tinyint(4) NOT NULL DEFAULT 100," "`size` float NOT NULL DEFAULT 0," "`used` int(11) NOT NULL DEFAULT 0," + "`valid` tinyint(1) NOT NULL DEFAULT 0," "PRIMARY KEY (`record`)," "UNIQUE KEY `uuid` (`uuid`)," "UNIQUE KEY `package` (`laboratory`,`form`,`package`),"