add cms, add todo
[ssproject1617.git] / testcms-final-anon / install / test.sql
1
2 DROP TABLE IF EXISTS `comments`;
3
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,
11 `text` text NOT NULL,
12 PRIMARY KEY (`id`),
13 KEY `post` (`post`),
14 KEY `status` (`status`)
15 ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
16
17 DROP TABLE IF EXISTS `meta`;
18
19 CREATE TABLE `meta` (
20 `key` varchar(140) NOT NULL,
21 `value` text NOT NULL,
22 PRIMARY KEY (`key`)
23 ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
24
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');
26
27 DROP TABLE IF EXISTS `pages`;
28
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,
36 PRIMARY KEY (`id`),
37 KEY `status` (`status`),
38 KEY `slug` (`slug`)
39 ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
40
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');
44
45 DROP TABLE IF EXISTS `posts`;
46
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,
52 `html` text NOT NULL,
53 `css` text NOT NULL,
54 `js` text NOT NULL,
55 `custom_fields` text,
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,
60 PRIMARY KEY (`id`),
61 KEY `status` (`status`),
62 KEY `slug` (`slug`)
63 ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
64
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);
67
68 DROP TABLE IF EXISTS `users`;
69
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,
76 `bio` text NOT NULL,
77 `status` enum('inactive','active') NOT NULL,
78 `role` enum('administrator','editor','user') NOT NULL,
79 PRIMARY KEY (`id`)
80 ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
81
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');
85
86 DROP TABLE IF EXISTS `sessions`;
87
88 CREATE TABLE IF NOT EXISTS `sessions` (
89 `id` CHAR( 32 ) NOT NULL ,
90 `date` DATETIME NOT NULL ,
91 `ip` VARCHAR( 15 ) NOT NULL ,
92 `ua` TEXT NOT NULL ,
93 `data` TEXT NOT NULL
94 ) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;