-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.sql
More file actions
43 lines (43 loc) · 1.59 KB
/
Copy pathdb.sql
File metadata and controls
43 lines (43 loc) · 1.59 KB
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
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`auth` varchar(100) NOT NULL DEFAULT '0',
`username` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`password` varchar(255) NOT NULL DEFAULT '',
`avatar` varchar(255) DEFAULT 'default.jpg',
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL,
`is_admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_confirmed` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
`password_reset` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `ci_sessions` (
`id` varchar(40) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
`data` blob NOT NULL,
PRIMARY KEY (id),
KEY `ci_sessions_timestamp` (`timestamp`)
);
CREATE TABLE IF NOT EXISTS `subscribers` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`water_point_id` varchar(255) DEFAULT NULL,
`telegram_chat_id` varchar(255) DEFAULT NULL,
`province` varchar(255) DEFAULT NULL,
`district` varchar(255) DEFAULT NULL,
`chiefdom` varchar(255) DEFAULT NULL,
`phone_number` varchar(255) NOT NULL DEFAULT '',
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `community_updates` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`water_point_id` varchar(255) DEFAULT NULL,
`attribute` varchar(255) DEFAULT NULL,
`condition` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`)
);