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