diff options
Diffstat (limited to 'mysql_schema.sql')
-rw-r--r-- | mysql_schema.sql | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/mysql_schema.sql b/mysql_schema.sql index 68c9479..fa5459b 100644 --- a/mysql_schema.sql +++ b/mysql_schema.sql @@ -22,24 +22,28 @@ CREATE TABLE `config` ( CREATE TABLE `pages` ( `short_name` char(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, `title` char(255) NOT NULL, - `md` text NOT NULL DEFAULT '', - `html` text NOT NULL DEFAULT '', - `ts` int(10) UNSIGNED NOT NULL DEFAULT 0, - `update_ts` int(10) UNSIGNED NOT NULL DEFAULT 0, - `visible` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 + `md` text CHARACTER SET utf8mb4 NOT NULL DEFAULT '\'\'', + `html` text CHARACTER SET utf8mb4 NOT NULL DEFAULT '\'\'', + `ts` int(10) unsigned NOT NULL DEFAULT 0, + `update_ts` int(10) unsigned NOT NULL DEFAULT 0, + `visible` tinyint(3) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`short_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `posts` ( - `id` int(10) UNSIGNED NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` char(255) NOT NULL, - `md` text NOT NULL, - `html` text NOT NULL, - `text` text NOT NULL, - `ts` int(10) UNSIGNED NOT NULL DEFAULT 0, - `update_ts` int(10) UNSIGNED NOT NULL DEFAULT 0, - `visible` tinyint(1) UNSIGNED NOT NULL DEFAULT 0, - `short_name` char(64) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + `md` text CHARACTER SET utf8mb4 NOT NULL, + `html` text CHARACTER SET utf8mb4 NOT NULL, + `text` text CHARACTER SET utf8mb4 NOT NULL, + `ts` int(10) unsigned NOT NULL DEFAULT 0, + `update_ts` int(10) unsigned NOT NULL DEFAULT 0, + `visible` tinyint(1) unsigned NOT NULL DEFAULT 0, + `short_name` char(64) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `short_name` (`short_name`), + KEY ` visible_ts_idx` (`visible`,`ts`) +) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8; CREATE TABLE `posts_tags` ( `id` int(11) NOT NULL, |