-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.sql
283 lines (246 loc) · 8.94 KB
/
database.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
-- Adminer 4.7.8 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP DATABASE IF EXISTS `zogwine`;
CREATE DATABASE `zogwine` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `zogwine`;
DROP TABLE IF EXISTS `devices`;
CREATE TABLE `devices` (
`idDevice` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`port` int(11) DEFAULT NULL,
`user` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`device` text DEFAULT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`idDevice`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `episodes`;
CREATE TABLE `episodes` (
`idEpisode` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`overview` text DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
`season` int(11) DEFAULT NULL,
`episode` int(11) DEFAULT NULL,
`rating` int(11) DEFAULT NULL,
`scraperName` char(10) DEFAULT NULL,
`scraperID` int(11) DEFAULT NULL,
`scraperData` text DEFAULT NULL,
`filler` int(11) DEFAULT 0,
`idShow` int(11) DEFAULT NULL,
`idVid` int(11) DEFAULT NULL,
`addDate` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`forceUpdate` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`idEpisode`),
KEY `idShow` (`idShow`),
KEY `idVid` (`idVid`),
CONSTRAINT `episodes_ibfk_1` FOREIGN KEY (`idShow`) REFERENCES `tv_shows` (`idShow`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `movies`;
CREATE TABLE `movies` (
`idMovie` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`overview` text DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
`fanart` varchar(255) DEFAULT NULL,
`rating` varchar(255) DEFAULT NULL,
`premiered` varchar(255) DEFAULT NULL,
`idCollection` int(11) DEFAULT NULL,
`scraperName` char(10) DEFAULT NULL,
`scraperID` int(10) DEFAULT NULL,
`scraperData` varchar(255) DEFAULT NULL,
`idVid` int(11) DEFAULT NULL,
`addDate` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`multipleResults` longtext DEFAULT NULL,
`forceUpdate` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`idMovie`),
KEY `idCollection` (`idCollection`),
KEY `idVid` (`idVid`),
CONSTRAINT `movies_ibfk_1` FOREIGN KEY (`idCollection`) REFERENCES `movie_collections` (`idCollection`),
CONSTRAINT `movies_ibfk_2` FOREIGN KEY (`idVid`) REFERENCES `video_files` (`idVid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `movie_collections`;
CREATE TABLE `movie_collections` (
`idCollection` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`overview` text DEFAULT NULL,
`premiered` varchar(255) DEFAULT NULL,
`icon` text DEFAULT NULL,
`fanart` text DEFAULT NULL,
`scraperName` varchar(255) NOT NULL,
`scraperID` int(11) NOT NULL,
`scraperData` text DEFAULT NULL,
`forceUpdate` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`idCollection`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `people`;
CREATE TABLE `people` (
`idPers` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`gender` int(11) DEFAULT NULL,
`birthdate` date DEFAULT NULL,
`deathdate` date DEFAULT NULL,
`description` text DEFAULT NULL,
`icon` text DEFAULT NULL,
`known_for` varchar(255) DEFAULT NULL,
`forceUpdate` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`idPers`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `people_link`;
CREATE TABLE `people_link` (
`idPers` int(11) NOT NULL,
`idMedia` int(11) NOT NULL,
`mediaType` int(11) NOT NULL,
`role` varchar(255) NOT NULL,
KEY `idPers` (`idPers`),
CONSTRAINT `people_link_ibfk_1` FOREIGN KEY (`idPers`) REFERENCES `people` (`idPers`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `scrapers`;
CREATE TABLE `scrapers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`scraperName` varchar(255) NOT NULL,
`scraperURL` varchar(255) NOT NULL,
`mediaType` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `scrapers` (`id`, `scraperName`, `scraperURL`, `mediaType`) VALUES
(1, 'tmdb', 'https://www.themoviedb.org/tv/', 1),
(2, 'tvdb', 'https://thetvdb.com/?tab=series&id=', 1),
(3, 'imdb', 'https://www.imdb.com/title/', 1),
(4, 'tmdb', 'https://www.themoviedb.org/movie/', 3);
DROP TABLE IF EXISTS `seasons`;
CREATE TABLE `seasons` (
`idShow` int(11) NOT NULL,
`season` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`overview` text DEFAULT NULL,
`icon` text DEFAULT NULL,
`premiered` varchar(255) DEFAULT NULL,
`forceUpdate` tinyint(4) NOT NULL,
KEY `idShow` (`idShow`),
KEY `season` (`season`),
CONSTRAINT `seasons_ibfk_1` FOREIGN KEY (`idShow`) REFERENCES `tv_shows` (`idShow`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `status`;
CREATE TABLE `status` (
`idStatus` int(11) NOT NULL AUTO_INCREMENT,
`idUser` int(11) NOT NULL,
`idMedia` int(11) NOT NULL,
`mediaType` int(11) NOT NULL,
`watchCount` int(11) NOT NULL DEFAULT 0,
`watchTime` int(11) NOT NULL DEFAULT 0,
`lastDate` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idStatus`),
KEY `idUser` (`idUser`),
CONSTRAINT `status_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `users` (`idUser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `tags`;
CREATE TABLE `tags` (
`idTag` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
`icon` text DEFAULT NULL,
PRIMARY KEY (`idTag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `tags_link`;
CREATE TABLE `tags_link` (
`idTag` int(11) NOT NULL,
`idMedia` int(11) NOT NULL,
`mediaType` int(11) NOT NULL,
KEY `idTag` (`idTag`),
CONSTRAINT `tags_link_ibfk_1` FOREIGN KEY (`idTag`) REFERENCES `tags` (`idTag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `trackers`;
CREATE TABLE `trackers` (
`idTracker` int(11) NOT NULL AUTO_INCREMENT,
`idUser` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`user` text DEFAULT NULL,
`password` text DEFAULT NULL,
`address` text DEFAULT NULL,
`port` int(11) DEFAULT NULL,
`data` text DEFAULT NULL,
`direction` int(11) NOT NULL,
`syncTypes` text NOT NULL,
`enabled` tinyint(4) NOT NULL,
KEY `idTracker` (`idTracker`),
KEY `idUser` (`idUser`),
CONSTRAINT `trackers_ibfk_2` FOREIGN KEY (`idUser`) REFERENCES `users` (`idUser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `trackers_link`;
CREATE TABLE `trackers_link` (
`mediaType` int(11) NOT NULL,
`mediaData` text NOT NULL,
`idTracker` int(11) NOT NULL,
`trackerData` text NOT NULL,
`enabled` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `tv_shows`;
CREATE TABLE `tv_shows` (
`idShow` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`overview` text DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
`fanart` varchar(255) DEFAULT NULL,
`rating` int(11) DEFAULT NULL,
`premiered` varchar(255) DEFAULT NULL,
`scraperName` char(10) DEFAULT NULL,
`scraperID` int(11) DEFAULT NULL,
`scraperData` varchar(255) DEFAULT NULL,
`fillerLink` text DEFAULT NULL,
`path` varchar(255) DEFAULT NULL,
`multipleResults` longtext DEFAULT NULL,
`forceUpdate` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`idShow`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `upcoming_episodes`;
CREATE TABLE `upcoming_episodes` (
`idEpisode` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`overview` text DEFAULT NULL,
`season` int(11) DEFAULT NULL,
`episode` int(11) DEFAULT NULL,
`date` date DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
`idShow` int(11) NOT NULL,
PRIMARY KEY (`idEpisode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`idUser` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`user` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`admin` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
`cast` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
`receive` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
`indexof` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0,
`allowMovie` tinyint(1) unsigned zerofill NOT NULL DEFAULT 1,
`allowTvs` tinyint(1) unsigned zerofill NOT NULL DEFAULT 1,
PRIMARY KEY (`idUser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `video_files`;
CREATE TABLE `video_files` (
`idVid` int(11) NOT NULL AUTO_INCREMENT,
`mediaType` int(11) NOT NULL,
`path` text NOT NULL,
`format` varchar(255) DEFAULT NULL,
`duration` float NOT NULL,
`extension` varchar(10) NOT NULL,
`audio` longtext NOT NULL,
`subtitles` longtext DEFAULT NULL,
`stereo3d` tinyint(4) NOT NULL DEFAULT 0,
`ratio` varchar(20) DEFAULT NULL,
`dimension` varchar(50) DEFAULT NULL,
`pix_fmt` varchar(50) DEFAULT NULL,
`video_codec` varchar(50) DEFAULT NULL,
`size` bigint(20) NOT NULL,
PRIMARY KEY (`idVid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 2021-05-02 19:31:50