-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdatabase.sql
More file actions
84 lines (71 loc) · 3.36 KB
/
database.sql
File metadata and controls
84 lines (71 loc) · 3.36 KB
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
83
84
--
-- Структура таблицы `answerers`
--
CREATE TABLE IF NOT EXISTS `answerers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`surname` varchar(80) NOT NULL,
`name` varchar(80) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Дамп данных таблицы `answerers`
--
INSERT INTO `answerers` (`id`, `surname`, `name`) VALUES
(1, 'Торвальдс', 'Линус'),
(2, 'Лердорф', 'Расмус'),
(3, 'Айк', 'Брендан'),
(4, 'Павлов', 'Алексей');
-- --------------------------------------------------------
--
-- Структура таблицы `questions`
--
CREATE TABLE IF NOT EXISTS `questions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`category` smallint(5) unsigned NOT NULL,
`answerer` int(10) unsigned NOT NULL,
`title` tinytext NOT NULL,
`text` text NOT NULL,
`answer` text NOT NULL,
`created` datetime NOT NULL,
`changed` datetime NOT NULL,
`answered` datetime DEFAULT NULL,
`author` varchar(40) NOT NULL,
`shown` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
KEY `pastor` (`answerer`),
KEY `created` (`created`),
KEY `answered` (`answered`),
KEY `shown` (`shown`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
--
-- Дамп данных таблицы `questions`
--
INSERT INTO `questions` (`id`, `category`, `answerer`, `title`, `text`, `answer`, `created`, `changed`, `answered`, `author`, `shown`) VALUES
(1, 1, 1, 'Как установить Линукс?', 'У меня на компьютере Windows, как мне поставить Linux?', '', '2012-05-03 00:00:00', '2012-07-15 16:31:35', NULL, 'Джон Доу', 1),
(2, 2, 2, 'Как сделать сайт?', 'Хочу сделать сайт, чтобы мои фанаты могли заходить туда. Как мне его сделать?', '', '2012-05-04 00:26:03', '2012-07-15 16:28:30', NULL, 'Кащей Б.', 1),
(3, 3, 3, 'Есть ли какие-нибудь хорошие библиотеки для создания сайтов на Javascript?', 'Есть ли какие-нибудь хорошие библиотеки для создания сайтов на Javascript?', 'Да, конечно, есть отличная библиотека AngularJs.', '2012-05-04 00:27:05', '2012-05-04 16:52:34', '2012-05-04 00:27:05', 'Садовник', 1),
(9, 4, 4, 'Что такое AngularJs?', 'Что такое AngularJs? Где мне про него почитать?', '', '2012-08-14 00:00:00', '2012-08-14 00:00:00', NULL, 'Иванов П.С.', 1);
-- --------------------------------------------------------
--
-- Структура таблицы `question_categories`
--
CREATE TABLE IF NOT EXISTS `question_categories` (
`id` smallint(6) NOT NULL AUTO_INCREMENT,
`parent` smallint(6) DEFAULT NULL,
`title` varchar(40) NOT NULL,
`alias` varchar(40) NOT NULL,
`shown` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `alias` (`alias`),
KEY `parent` (`parent`),
KEY `shown` (`shown`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Дамп данных таблицы `question_categories`
--
INSERT INTO `question_categories` (`id`, `parent`, `title`, `alias`, `shown`) VALUES
(1, NULL, 'Серверы', 'server', 1),
(2, NULL, 'PHP', 'php', 1),
(3, NULL, 'Javascript', 'javascript', 1),
(4, NULL, 'Angular', 'angular', 1);