From 5072415cd8ad96ec8d454f3e7b5306e03eb1653b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 16 Jul 2019 15:16:18 +0100 Subject: [PATCH] Bug 23321: Add cash_registers table --- .../data/mysql/atomicupdate/bug_23321.perl | 21 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 18 ++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_23321.perl diff --git a/installer/data/mysql/atomicupdate/bug_23321.perl b/installer/data/mysql/atomicupdate/bug_23321.perl new file mode 100644 index 0000000000..db8044cafc --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23321.perl @@ -0,0 +1,21 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + + $dbh->do(qq{ +CREATE TABLE `cash_registers` ( + `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register + `name` varchar(24) NOT NULL, -- the user friendly identifier for each account register + `description` longtext NOT NULL, -- the user friendly description for each account register + `branch` varchar(10) NOT NULL, -- the foreign key the library this account register belongs + `branch_default` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote that this till is the branch default + `starting_float` decimal(28, 6), -- the starting float this account register should be assigned + `archived` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote if this till is archived or not + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`,`branch`), + 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; + }); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 23321 - Add cash_registers table)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 2c7f361f9b..235521f48f 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2655,6 +2655,24 @@ CREATE TABLE `account_offsets` ( CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `cash_registers` +-- + +DROP TABLE IF EXISTS `cash_registers`; +CREATE TABLE `cash_registers` ( + `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register + `name` varchar(24) NOT NULL, -- the user friendly identifier for each account register + `description` longtext NOT NULL, -- the user friendly description for each account register + `branch` varchar(10) NOT NULL, -- the foreign key the library this account register belongs + `branch_default` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote that this till is the branch default + `starting_float` decimal(28, 6), -- the starting float this account register should be assigned + `archived` tinyint(1) NOT NULL DEFAULT 0, -- boolean flag to denote if this till is archived or not + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`,`branch`), + 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; + -- -- Table structure for table `action_logs` -- -- 2.20.1