Lines 86-104
CREATE TABLE `account_debit_types_branches` (
Link Here
|
86 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
86 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
87 |
/*!40101 SET character_set_client = @saved_cs_client */; |
87 |
/*!40101 SET character_set_client = @saved_cs_client */; |
88 |
|
88 |
|
89 |
-- |
|
|
90 |
-- Table structure for table `account_offset_types` |
91 |
-- |
92 |
|
93 |
DROP TABLE IF EXISTS `account_offset_types`; |
94 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
95 |
/*!40101 SET character_set_client = utf8 */; |
96 |
CREATE TABLE `account_offset_types` ( |
97 |
`type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The type of offset this is', |
98 |
PRIMARY KEY (`type`) |
99 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
100 |
/*!40101 SET character_set_client = @saved_cs_client */; |
101 |
|
102 |
-- |
89 |
-- |
103 |
-- Table structure for table `account_offsets` |
90 |
-- Table structure for table `account_offsets` |
104 |
-- |
91 |
-- |
Lines 110-125
CREATE TABLE `account_offsets` (
Link Here
|
110 |
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier for each offset', |
97 |
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier for each offset', |
111 |
`credit_id` int(11) DEFAULT NULL COMMENT 'The id of the accountline the increased the patron''s balance', |
98 |
`credit_id` int(11) DEFAULT NULL COMMENT 'The id of the accountline the increased the patron''s balance', |
112 |
`debit_id` int(11) DEFAULT NULL COMMENT 'The id of the accountline that decreased the patron''s balance', |
99 |
`debit_id` int(11) DEFAULT NULL COMMENT 'The id of the accountline that decreased the patron''s balance', |
113 |
`type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The type of offset this is', |
100 |
`type` enum('CREATE','APPLY','VOID','OVERDUE_INCREASE','OVERDUE_DECREASE') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The type of offset this is', |
114 |
`amount` decimal(26,6) NOT NULL COMMENT 'The amount of the change', |
101 |
`amount` decimal(26,6) NOT NULL COMMENT 'The amount of the change', |
115 |
`created_on` timestamp NOT NULL DEFAULT current_timestamp(), |
102 |
`created_on` timestamp NOT NULL DEFAULT current_timestamp(), |
116 |
PRIMARY KEY (`id`), |
103 |
PRIMARY KEY (`id`), |
117 |
KEY `account_offsets_ibfk_p` (`credit_id`), |
104 |
KEY `account_offsets_ibfk_p` (`credit_id`), |
118 |
KEY `account_offsets_ibfk_f` (`debit_id`), |
105 |
KEY `account_offsets_ibfk_f` (`debit_id`), |
119 |
KEY `account_offsets_ibfk_t` (`type`), |
|
|
120 |
CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, |
106 |
CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, |
121 |
CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, |
107 |
CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE |
122 |
CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE |
|
|
123 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
108 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
124 |
/*!40101 SET character_set_client = @saved_cs_client */; |
109 |
/*!40101 SET character_set_client = @saved_cs_client */; |
125 |
|
110 |
|