-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
init-db-old.sql
169 lines (141 loc) · 7.44 KB
/
init-db-old.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
-- Adminer 4.7.6 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
USE `burner2`;
SET NAMES utf8mb4;
CREATE TABLE `article` (
`id` int NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL,
`image_top` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`image_bottom` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`visible` tinyint NOT NULL DEFAULT '1',
`date_created` datetime DEFAULT NULL,
`date_updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`user_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `updated_by` (`user_id`),
CONSTRAINT `article_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `article_images` (
`id` int NOT NULL AUTO_INCREMENT,
`article_id` int NOT NULL,
`filename` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`sort` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `article_id` (`article_id`),
CONSTRAINT `article_images_ibfk_1` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `article_tag` (
`id` int NOT NULL AUTO_INCREMENT,
`article_id` int DEFAULT NULL,
`tag_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `article_id` (`article_id`),
KEY `tag_id` (`tag_id`),
CONSTRAINT `article_tag_ibfk_1` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`) ON DELETE CASCADE,
CONSTRAINT `article_tag_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `article_translation` (
`id` int NOT NULL AUTO_INCREMENT,
`article_id` int NOT NULL,
`locale` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'en',
`title` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`perex` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci,
`text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci,
`htaccess` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`date_created` datetime DEFAULT NULL,
`date_updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `article_id` (`article_id`),
CONSTRAINT `article_translation_ibfk_1` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `contact_form` (
`id` int NOT NULL AUTO_INCREMENT,
`data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`datetime` datetime NOT NULL,
`ip` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `gallery` (
`id` int NOT NULL AUTO_INCREMENT,
`title` varchar(90) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`htaccess` varchar(90) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`date` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`date_created` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`date_updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`user_id` int DEFAULT NULL,
`visible` int NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
CONSTRAINT `gallery_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `gallery_images` (
`id` int NOT NULL AUTO_INCREMENT,
`gallery_id` int NOT NULL,
`filename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`sort` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `gallery_id` (`gallery_id`),
CONSTRAINT `gallery_images_ibfk_1` FOREIGN KEY (`gallery_id`) REFERENCES `gallery` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `page` (
`id` int NOT NULL AUTO_INCREMENT,
`parent_id` int NOT NULL DEFAULT '0',
`level` int NOT NULL DEFAULT '0',
`order` int NOT NULL DEFAULT '9999',
`type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'content',
`image` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`visible` tinyint(1) DEFAULT '0',
`url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `page_image` (
`id` int NOT NULL AUTO_INCREMENT,
`page_id` int NOT NULL,
`filename` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `page_translation` (
`id` int NOT NULL AUTO_INCREMENT,
`page_id` int DEFAULT NULL,
`locale` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`title` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`perex` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci,
`text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci,
`htaccess` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `tags` (
`id` int NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`htaccess` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`date_created` datetime NOT NULL,
`date_updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
CREATE TABLE `user` (
`id` int NOT NULL AUTO_INCREMENT,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`firstname` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`lastname` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`email` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
`ip` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`last_log` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`registration` datetime NOT NULL,
`role` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'u',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
INSERT INTO `user` (`id`, `password`, `firstname`, `lastname`, `email`, `ip`, `last_log`, `registration`, `role`) VALUES
(1, '$2y$10$Vabm8gWuaRdOhkTPK6tzeuKfogaBANd4FNr5ou5iXuVLunLdZIIau', 'Matt', 'Ronator', 'info@matronator.com', '127.0.0.1', '2021-01-01 15:54:13', '2021-01-01 00:00:00', 'a');
-- 2021-01-01 14:54:56