Bug 21336: (QA follow-up) Add column_exists in db revision

As requested by Josef on comment70.

Test plan:
Run db revision twice. No warnings.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2019-03-29 08:30:06 +00:00 committed by Nick Clemens
parent af84af7cb7
commit 5e1894c948

View file

@ -1,7 +1,7 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do( "ALTER TABLE borrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" );
$dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" );
$dbh->do( "ALTER TABLE borrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ) if !column_exists('borrowers', 'flgAnonymized');
$dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ) if !column_exists('deletedborrowers', 'flgAnonymized');
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 21336 - Add field flgAnonymized)\n";
}