Bug 23321: (QA follow-up) Make atomic update idempotent

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Tomás Cohen Arazi 2019-09-20 15:06:38 -03:00 committed by Martin Renvoize
parent f24597d2a0
commit 9aefd5845a
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -1,6 +1,7 @@
$DBversion = 'XXX'; # will be replaced by the RM
if ( CheckVersion($DBversion) ) {
unless ( TableExists( 'cash_registers' ) ) {
$dbh->do(qq{
CREATE TABLE `cash_registers` (
`id` int(11) NOT NULL auto_increment, -- unique identifier for each account register
@ -15,6 +16,7 @@ CREATE TABLE `cash_registers` (
CONSTRAINT cash_registers_branch FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
});
}
unless ( column_exists( 'accountlines', 'register_id' ) ) {
$dbh->do(qq{ALTER TABLE `accountlines` ADD `register_id` int(11) NULL DEFAULT NULL AFTER `manager_id`});