|
Lines 1-4
Link Here
|
| 1 |
CREATE TABLE `account_offset_types` ( |
1 |
DROP TABLE IF EXISTS `accountoffsets`; |
|
|
2 |
|
| 3 |
CREATE TABLE IF NOT EXISTS `account_offset_types` ( |
| 2 |
`type` varchar(16) NOT NULL, -- The type of offset this is |
4 |
`type` varchar(16) NOT NULL, -- The type of offset this is |
| 3 |
PRIMARY KEY (`type`) |
5 |
PRIMARY KEY (`type`) |
| 4 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
6 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
|
Lines 16-22
CREATE TABLE IF NOT EXISTS `account_offsets` (
Link Here
|
| 16 |
CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE |
18 |
CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE |
| 17 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
19 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
| 18 |
|
20 |
|
| 19 |
INSERT INTO account_offset_types ( type ) VALUES |
21 |
INSERT IGNORE INTO account_offset_types ( type ) VALUES |
| 20 |
('Writeoff'), |
22 |
('Writeoff'), |
| 21 |
('Payment'), |
23 |
('Payment'), |
| 22 |
('Lost Item'), |
24 |
('Lost Item'), |
| 23 |
- |
|
|