-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.sql
More file actions
24 lines (24 loc) · 1.38 KB
/
schema.sql
File metadata and controls
24 lines (24 loc) · 1.38 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
DROP TABLE IF EXISTS `messages`;
CREATE TABLE `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created_human` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Human readable time when a record was opened',
`created` varchar(12) NOT NULL COMMENT 'Epoch time when a record was created',
`lifetime` varchar(12) NOT NULL COMMENT 'How long does it valid',
`token` varchar(40) NOT NULL COMMENT 'CSRF token',
`link` varchar(32) NOT NULL COMMENT 'Link for external access',
`message` text NOT NULL COMMENT 'Encrypted message',
`file` longtext DEFAULT NULL COMMENT 'Base64 encoded file attachment',
`file_name` varchar(100) DEFAULT NULL COMMENT 'Original file name',
`psk` varchar(1) NOT NULL DEFAULT '0' COMMENT 'Is encrypted with additional password?',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
DROP TABLE IF EXISTS `msglogs`;
CREATE TABLE `msglogs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`msgid` varchar(6) NOT NULL COMMENT 'ID of the message from Messages table',
`msglink` varchar(150) NOT NULL COMMENT 'link for the message',
`opened` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Time when a record was opened',
`ip` varchar(20) NOT NULL COMMENT 'IP of an external access',
`type` varchar(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;