View | Details | Raw Unified | Return to bug 23355
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_23355.perl (+19 lines)
Line 0 Link Here
1
$DBversion = 'XXX';    # will be replaced by the RM
2
if ( CheckVersion($DBversion) ) {
3
4
    $dbh->do(qq{
5
CREATE TABLE `cash_register_actions` (
6
  `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register action
7
  `code` varchar(24) NOT NULL, -- action code denoting the type of action recorded (enum),
8
  `manager_id` int(11) NOT NULL, -- staff member performing the action
9
  `amount` decimal(28,6) DEFAULT NULL, -- amount recorded in action (signed)
10
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
11
  PRIMARY KEY (`id`),
12
  CONSTRAINT `cash_register_actions_manager` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
13
  CONSTRAINT `cash_register_actions_register` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
14
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
15
    });
16
17
    SetVersion($DBversion);
18
    print "Upgrade to $DBversion done (Bug 23355 - Add cash_register_actions table)\n";
19
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +16 lines)
Lines 2747-2752 CREATE TABLE `account_offsets` ( Link Here
2747
  CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE
2747
  CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE
2748
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2748
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2749
2749
2750
--
2751
-- Table structure for table `cash_register_actions`
2752
--
2753
2754
CREATE TABLE `cash_register_actions` (
2755
  `id` int(11) NOT NULL auto_increment, -- unique identifier for each account register action
2756
  `code` varchar(24) NOT NULL, -- action code denoting the type of action recorded (enum),
2757
  `register_id` int(11) NOT NULL, -- id of cash_register this action belongs to,
2758
  `manager_id` int(11) NOT NULL, -- staff member performing the action
2759
  `amount` decimal(28,6) DEFAULT NULL, -- amount recorded in action (signed)
2760
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2761
  PRIMARY KEY (`id`),
2762
  CONSTRAINT `cash_register_actions_manager` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2763
  CONSTRAINT `cash_register_actions_register` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
2764
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
2765
2750
--
2766
--
2751
-- Table structure for table `action_logs`
2767
-- Table structure for table `action_logs`
2752
--
2768
--
2753
- 

Return to bug 23355