2 DROP TABLE IF EXISTS `
comments`
;
4 CREATE TABLE IF NOT EXISTS `
comments`
(
5 `
id`
int(6) NOT NULL AUTO_INCREMENT
,
6 `post`
int(6) NOT NULL,
7 `status`
enum('pending','published','spam') NOT NULL,
8 `
date`
int(11) NOT NULL,
9 `
name`
varchar(140) NOT NULL,
10 `email`
varchar(140) NOT NULL,
14 KEY `status`
(`status`
)
15 ) ENGINE
=MyISAM CHARSET
=utf8
COLLATE=utf8_general_ci
;
17 DROP TABLE IF EXISTS `meta`
;
20 `
key`
varchar(140) NOT NULL,
21 `
value`
text NOT NULL,
23 ) ENGINE
=MyISAM CHARSET
=utf8
COLLATE=utf8_general_ci
;
25 INSERT INTO `meta`
(`
key`
, `
value`
) VALUES ('posts_page', '1'), ('home_page', '1'), ('twitter', ''), ('date_format', 'jS M, Y'), ('auto_published_comments', '1'), ('posts_per_page', '10');
27 DROP TABLE IF EXISTS `pages`
;
29 CREATE TABLE `pages`
(
30 `
id`
int(6) NOT NULL AUTO_INCREMENT
,
31 `slug`
varchar(150) NOT NULL,
32 `
name`
varchar(64) NOT NULL,
33 `title`
varchar(150) NOT NULL,
34 `
content`
text NOT NULL,
35 `status`
enum('draft','published','archived') NOT NULL,
37 KEY `status`
(`status`
),
39 ) ENGINE
=MyISAM CHARSET
=utf8
COLLATE=utf8_general_ci
;
41 INSERT INTO `pages`
(`slug`
, `
name`
, `title`
, `
content`
, `status`
) VALUES
42 ('posts', 'Posts', 'My posts and thoughts', '<p>Welcome!</p>', 'published'),
43 ('about', 'About', 'A little bit about me', '<p>This is a little bit of text about me.</p>', 'published');
45 DROP TABLE IF EXISTS `posts`
;
47 CREATE TABLE `posts`
(
48 `
id`
int(6) NOT NULL AUTO_INCREMENT
,
49 `title`
varchar(150) NOT NULL,
50 `slug`
varchar(150) NOT NULL,
51 `description`
text NOT NULL,
56 `created`
int(11) NOT NULL,
57 `author`
int(6) NOT NULL,
58 `status`
enum('draft','published','archived') NOT NULL,
59 `
comments`
TINYINT( 1 ) NOT NULL,
61 KEY `status`
(`status`
),
63 ) ENGINE
=MyISAM CHARSET
=utf8
COLLATE=utf8_general_ci
;
65 INSERT INTO `posts`
(`title`
, `slug`
, `description`
, `html`
, `css`
, `js`
, `created`
, `author`
, `status`
, `
comments`
) VALUES
66 ('Hello World', 'hello', 'Hello World.', '<p>My first post.</p>', '', '', '[[now]]', 1, 'published', 1);
68 DROP TABLE IF EXISTS `users`
;
70 CREATE TABLE `users`
(
71 `
id`
int(6) NOT NULL AUTO_INCREMENT
,
72 `username`
varchar(100) NOT NULL,
73 `
password`
varchar(140) NOT NULL,
74 `email`
varchar(140) NOT NULL,
75 `real_name`
varchar(140) NOT NULL,
77 `status`
enum('inactive','active') NOT NULL,
78 `
role`
enum('administrator','editor','user') NOT NULL,
80 ) ENGINE
=MyISAM CHARSET
=utf8
COLLATE=utf8_general_ci
;
82 INSERT INTO `users`
(`username`
, `
password`
, `email`
, `real_name`
, `bio`
, `status`
, `
role`
) VALUES
83 ('admin', '[[password]]', '[[email]]', 'Administrator', 'Default account for TestCMS
84 .', 'active', 'administrator');
86 DROP TABLE IF EXISTS `sessions`
;
88 CREATE TABLE IF NOT EXISTS `sessions`
(
89 `
id`
CHAR( 32 ) NOT NULL ,
90 `
date` DATETIME
NOT NULL ,
91 `ip`
VARCHAR( 15 ) NOT NULL ,
94 ) ENGINE
=InnoDB CHARSET
=utf8
COLLATE=utf8_general_ci
;