2020-05-24 09:49:37 +00:00
|
|
|
create table if not exists tags
|
|
|
|
(
|
|
|
|
tag_id int auto_increment
|
|
|
|
primary key,
|
|
|
|
tag_name varchar(50) null
|
|
|
|
);
|
|
|
|
|
2020-05-23 21:47:15 +00:00
|
|
|
create table if not exists videos
|
|
|
|
(
|
2020-05-24 09:49:37 +00:00
|
|
|
movie_id int auto_increment
|
2020-05-23 21:47:15 +00:00
|
|
|
primary key,
|
2020-05-24 09:49:37 +00:00
|
|
|
movie_name varchar(200) null,
|
2020-06-03 10:26:10 +00:00
|
|
|
movie_url varchar(250) null,
|
2020-05-24 09:49:37 +00:00
|
|
|
thumbnail mediumblob null,
|
2020-06-03 22:15:06 +00:00
|
|
|
poster mediumblob null,
|
2020-05-24 09:49:37 +00:00
|
|
|
likes int default 0 null,
|
2020-06-03 10:26:10 +00:00
|
|
|
quality int null,
|
2020-06-03 22:15:06 +00:00
|
|
|
length int null comment 'in seconds',
|
|
|
|
create_date datetime default CURRENT_TIMESTAMP null
|
2020-05-23 21:47:15 +00:00
|
|
|
);
|
2020-05-24 09:49:37 +00:00
|
|
|
|
|
|
|
create table if not exists video_tags
|
|
|
|
(
|
|
|
|
tag_id int null,
|
|
|
|
video_id int null,
|
|
|
|
constraint video_tags_tags_tag_id_fk
|
|
|
|
foreign key (tag_id) references tags (tag_id),
|
|
|
|
constraint video_tags_videos_movie_id_fk
|
|
|
|
foreign key (video_id) references videos (movie_id)
|
2020-10-03 07:06:27 +00:00
|
|
|
on delete cascade
|
2020-06-03 10:26:10 +00:00
|
|
|
);
|
2020-06-03 22:15:06 +00:00
|
|
|
|
2020-10-03 20:28:19 +00:00
|
|
|
create table if not exists settings
|
2020-07-17 23:10:04 +00:00
|
|
|
(
|
|
|
|
video_path varchar(255) null,
|
|
|
|
episode_path varchar(255) null,
|
|
|
|
password varchar(32) default '-1' null,
|
|
|
|
mediacenter_name varchar(32) default 'OpenMediaCenter' null,
|
2020-07-28 16:17:17 +00:00
|
|
|
TMDB_grabbing tinyint null,
|
|
|
|
DarkMode tinyint default 0 null
|
2020-07-17 23:10:04 +00:00
|
|
|
);
|
|
|
|
|
2020-06-03 22:15:06 +00:00
|
|
|
INSERT INTO tags (tag_id, tag_name)
|
|
|
|
VALUES (2, 'fullhd');
|
|
|
|
INSERT INTO tags (tag_id, tag_name)
|
|
|
|
VALUES (3, 'lowquality');
|
|
|
|
INSERT INTO tags (tag_id, tag_name)
|
|
|
|
VALUES (4, 'hd');
|
2020-07-17 23:10:04 +00:00
|
|
|
|
|
|
|
INSERT INTO settings (video_path, episode_path, password, mediacenter_name)
|
|
|
|
VALUES ('./videos/', './tvshows/', -1, 'OpenMediaCenter');
|