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

(-)a/installer/data/mysql/atomicupdate/bug_14826.sql (+12 lines)
Line 0 Link Here
1
DROP TABLE IF EXISTS `accountoffsets`;
2
CREATE TABLE IF NOT EXISTS `account_offsets` (
3
  `id` int(11) NOT NULL auto_increment, -- unique identifier for each offset
4
  `credit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline the increased the patron's balance
5
  `debit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline that decreased the patron's balance
6
  `type` varchar(16) NOT NULL, -- The type of offset this is
7
  `amount` decimal(26,6) NOT NULL, -- The amount of the change
8
  `created_on` timestamp NOT NULL default CURRENT_TIMESTAMP,
9
  PRIMARY KEY (`id`),
10
  CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE,
11
  CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE
12
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
(-)a/installer/data/mysql/kohastructure.sql (-10 / +12 lines)
Lines 2710-2726 CREATE TABLE `accountlines` ( Link Here
2710
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2710
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2711
2711
2712
--
2712
--
2713
-- Table structure for table `accountoffsets`
2713
-- Table structure for table `account_offsets`
2714
--
2714
--
2715
2715
2716
DROP TABLE IF EXISTS `accountoffsets`;
2716
DROP TABLE IF EXISTS `account_offsets`;
2717
CREATE TABLE `accountoffsets` (
2717
CREATE TABLE `account_offsets` (
2718
  `borrowernumber` int(11) NOT NULL default 0,
2718
  `id` int(11) NOT NULL auto_increment, -- unique identifier for each offset
2719
  `accountno` smallint(6) NOT NULL default 0,
2719
  `credit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline the increased the patron's balance
2720
  `offsetaccount` smallint(6) NOT NULL default 0,
2720
  `debit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline that decreased the patron's balance
2721
  `offsetamount` decimal(28,6) default NULL,
2721
  `type` varchar(16) NOT NULL, -- The type of offset this is
2722
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2722
  `amount` decimal(26,6) NOT NULL, -- The amount of the change
2723
  CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2723
  `created_on` timestamp NOT NULL default CURRENT_TIMESTAMP,
2724
  PRIMARY KEY (`id`),
2725
  CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2726
  CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE
2724
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2727
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2725
2728
2726
--
2729
--
2727
- 

Return to bug 14826