From be3c868169b049a33e477bf31fa63e8c3a431899 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 25 Mar 2020 11:19:17 +0000 Subject: [PATCH] Bug 23355: (RM follow-up) Make DB update idempotent Signed-off-by: Martin Renvoize --- installer/data/mysql/updatedatabase.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8a7c08b70e..65ecbb7169 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -21274,14 +21274,14 @@ if( CheckVersion( $DBversion ) ) { $DBversion = '19.12.00.054'; if( CheckVersion( $DBversion ) ) { $dbh->do(qq{ - CREATE TABLE desks ( -- desks available in a library - desk_id int(11) NOT NULL auto_increment, -- unique identifier added by Koha - desk_name varchar(100) NOT NULL default '', -- name of the desk - branchcode varchar(10) NOT NULL, -- library the desk is located at - PRIMARY KEY (desk_id), - KEY `fk_desks_branchcode` (branchcode), - CONSTRAINT `fk_desks_branchcode` FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + CREATE TABLE IF NOT EXISTS `desks` ( -- desks available in a library + `desk_id` int(11) NOT NULL auto_increment, -- unique identifier added by Koha + `desk_name` varchar(100) NOT NULL default '', -- name of the desk + `branchcode` varchar(10) NOT NULL, -- library the desk is located at + PRIMARY KEY (`desk_id`), + KEY `fk_desks_branchcode` (`branchcode`), + CONSTRAINT `fk_desks_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; }); NewVersion( $DBversion, 13881, "Add desk management"); -- 2.39.5