-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.db.tablesyntax
47 lines (45 loc) · 1.96 KB
/
INSTALL.db.tablesyntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
CREATE TABLE `registrations` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`structure_version` int(11) unsigned DEFAULT NULL,
`mnemonic` varchar(64) DEFAULT NULL,
`type` enum('company','individual','agriculture') NOT NULL,
`company_name` varchar(128) DEFAULT NULL,
`uid` varchar(16) DEFAULT NULL,
`firstname` varchar(64) DEFAULT NULL,
`lastname` varchar(64) DEFAULT NULL,
`birthdate` varchar(10) DEFAULT NULL,
`street` varchar(64) DEFAULT NULL,
`number` varchar(16) DEFAULT NULL,
`city` varchar(32) DEFAULT NULL,
`zip` smallint(11) unsigned DEFAULT NULL,
`phone` varchar(32) DEFAULT NULL,
`email` varchar(64) DEFAULT NULL,
`banking_name` varchar(128) DEFAULT NULL,
`banking_iban` varchar(34) DEFAULT NULL,
`banking_consent` int(11) unsigned DEFAULT NULL COMMENT 'good until March 7, 2106',
`registration_date` int(11) unsigned DEFAULT NULL,
`migration_date` int(11) unsigned DEFAULT NULL,
`delivery_date` int(11) unsigned DEFAULT NULL,
`ip_address` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `meters` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`registration_id` int(11) DEFAULT NULL,
`meter_id` varchar(40) DEFAULT NULL,
`meter_uuid` varchar(40) DEFAULT NULL,
`meter_type` enum('supplier','consumer') DEFAULT NULL,
`meter_power` varchar(6) DEFAULT NULL,
`meter_addr_street` varchar(64) DEFAULT NULL,
`meter_addr_number` varchar(16) DEFAULT NULL,
`meter_addr_zip` smallint(5) unsigned DEFAULT NULL,
`meter_addr_city` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `storages` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`registration_id` int(11) DEFAULT NULL,
`storage_uuid` varchar(40) DEFAULT NULL,
`storage_capacity` varchar(6) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;