Lines 2689-2705
CREATE TABLE `accountlines` (
Link Here
|
2689 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
2689 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
2690 |
|
2690 |
|
2691 |
-- |
2691 |
-- |
2692 |
-- Table structure for table `accountoffsets` |
2692 |
-- Table structure for table `account_offsets` |
2693 |
-- |
2693 |
-- |
2694 |
|
2694 |
|
2695 |
DROP TABLE IF EXISTS `accountoffsets`; |
2695 |
DROP TABLE IF EXISTS `account_offsets`; |
2696 |
CREATE TABLE `accountoffsets` ( |
2696 |
CREATE TABLE `account_offsets` ( |
2697 |
`borrowernumber` int(11) NOT NULL default 0, |
2697 |
`id` int(11) NOT NULL auto_increment, -- unique identifier for each offset |
2698 |
`accountno` smallint(6) NOT NULL default 0, |
2698 |
`credit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline the increased the patron's balance |
2699 |
`offsetaccount` smallint(6) NOT NULL default 0, |
2699 |
`debit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline that decreased the patron's balance |
2700 |
`offsetamount` decimal(28,6) default NULL, |
2700 |
`type` varchar(16) NOT NULL, -- The type of offset this is |
2701 |
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, |
2701 |
`amount` decimal(26,6) NOT NULL, -- The amount of the change |
2702 |
CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE |
2702 |
`created_on` timestamp NOT NULL default CURRENT_TIMESTAMP, |
|
|
2703 |
PRIMARY KEY (`id`), |
2704 |
CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, |
2705 |
CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE |
2703 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
2706 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
2704 |
|
2707 |
|
2705 |
-- |
2708 |
-- |
2706 |
- |
|
|