-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcms.sql
82 lines (69 loc) · 2.69 KB
/
cms.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
-- Adminer 4.2.1 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE DATABASE `cms` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `cms`;
DROP TABLE IF EXISTS `languages`;
CREATE TABLE `languages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`short` varchar(255) COLLATE utf8_czech_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
INSERT INTO `languages` (`id`, `name`, `short`) VALUES
(1, 'Čeština', 'cs'),
(2, 'English', 'en');
DROP TABLE IF EXISTS `pages`;
CREATE TABLE `pages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`type` int(11) NOT NULL,
`text` text NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `posts`;
CREATE TABLE `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`language_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`content` text COLLATE utf8_czech_ci NOT NULL,
`url` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`date` datetime NOT NULL,
`active` tinyint(4) NOT NULL,
`page_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `language_id` (`language_id`),
KEY `page_id` (`page_id`),
CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `posts_ibfk_2` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`),
CONSTRAINT `posts_ibfk_3` FOREIGN KEY (`page_id`) REFERENCES `pages` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `settings`;
CREATE TABLE `settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `settings` (`id`, `name`, `value`) VALUES
(1, 'name_web', 'Mega CMS'),
(2, 'primary_email', '[email protected]');
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`password` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`role` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`language_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `language_id` (`language_id`),
CONSTRAINT `users_ibfk_1` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
INSERT INTO `users` (`id`, `email`, `password`, `role`, `language_id`) VALUES
(1, 'Daidalos', '$2y$10$zHdp9D7J4vfMJuxVSg5OpOG2rFq2LqIkiAi1ipqS4PWNfoQfiBcSK', 'admin', 1);
-- 2015-10-20 20:32:27