-
Notifications
You must be signed in to change notification settings - Fork 0
/
structure.sql
1 lines (1 loc) · 3.61 KB
/
structure.sql
1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; CREATE TABLE `comments`( `id` int(11) NOT NULL, `parent` int(11) NOT NULL, `author` int(11) NOT NULL, `body` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `thread` int(11) NOT NULL, `edited` tinyint(1) NOT NULL, `timestamp` bigint(20) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `follows` ( `user` int(11) NOT NULL, `follow` int(11) NOT NULL, `timestamp` bigint(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `images` ( `name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `image` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `standard` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `thumb` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `remove` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `size` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `likes` ( `id` int(11) NOT NULL, `user` int(11) NOT NULL, `is_comment` tinyint(1) NOT NULL, `timestamp` bigint(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `posts` ( `id` int(11) NOT NULL, `title` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `author` int(11) NOT NULL, `type` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `body` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `edited` tinyint(1) NOT NULL, `timestamp` bigint(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `report` ( `user` int(11) NOT NULL, `id` int(11) NOT NULL, `is_comment` tinyint(1) NOT NULL, `reason` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `message` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `timestamp` bigint(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `reset_tokens` ( `account` int(11) NOT NULL, `used` tinyint(1) NOT NULL, `reset_key` varchar(32) NOT NULL, `token` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `timestamp` bigint(20) NOT NULL, `ip_address` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `saved` ( `user` int(11) NOT NULL, `post` int(11) NOT NULL, `timestamp` bigint(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `users` ( `id` int(11) NOT NULL, `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `username` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `email` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `profile_picture` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `banner` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `password` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `verified` tinyint(1) NOT NULL, `timestamp` bigint(20) NOT NULL, `last_edited` bigint(20) NOT NULL, `bio` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `session` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `created_ip` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `visits` ( `page` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `user` int(11) NOT NULL, `data` int(11) NOT NULL, `timestamp` bigint(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ALTER TABLE `comments` ADD PRIMARY KEY (`id`); ALTER TABLE `posts` ADD PRIMARY KEY (`id`); ALTER TABLE `users` ADD PRIMARY KEY (`id`) USING BTREE, ADD UNIQUE KEY `id` (`id`,`name`); ALTER TABLE `comments` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `posts` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT;