-
Notifications
You must be signed in to change notification settings - Fork 23
/
init.sql
26 lines (24 loc) · 904 Bytes
/
init.sql
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
DROP TABLE IF EXISTS `houses`;
CREATE TABLE `houses` (
`id` char(8) COLLATE utf8mb4_bin NOT NULL,
`view_count` INT(6) NOT NULL,
`html` text COLLATE utf8mb4_bin NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
DROP TABLE IF EXISTS `publichouses`;
CREATE TABLE `publichouses` (
`house_id` char(8) NOT NULL,
`title` varchar(128) COLLATE utf8mb4_bin NOT NULL,
`thumb_url` varchar(28) NOT NULL,
`added` datetime NOT NULL,
`updated` datetime NOT NULL,
`approved` tinyint(1) DEFAULT NULL,
`loves` int(4) NOT NULL,
PRIMARY KEY (`house_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE IF NOT EXISTS `tweetedhouses` (
`house_id` char(8) NOT NULL,
`tweet_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`house_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;