2020-12-11 18:23:13 +00:00
|
|
|
create table if not exists actors
|
|
|
|
(
|
2020-12-29 19:39:30 +00:00
|
|
|
actor_id int auto_increment
|
2020-12-11 18:23:13 +00:00
|
|
|
primary key,
|
|
|
|
name varchar(50) null,
|
|
|
|
thumbnail mediumblob null
|
|
|
|
)
|
|
|
|
comment 'informations about different actors';
|
|
|
|
|
|
|
|
create table if not exists settings
|
|
|
|
(
|
2021-04-22 18:31:36 +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,
|
|
|
|
TMDB_grabbing tinyint null,
|
|
|
|
DarkMode tinyint default 0 null
|
2020-12-11 18:23:13 +00:00
|
|
|
);
|
|
|
|
|
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
|
|
|
|
);
|
|
|
|
|
2021-04-16 20:44:56 +00:00
|
|
|
create table if not exists tvshow
|
|
|
|
(
|
2021-04-22 18:31:36 +00:00
|
|
|
name varchar(100) null,
|
|
|
|
thumbnail mediumblob null,
|
|
|
|
id int auto_increment
|
|
|
|
primary key,
|
|
|
|
foldername varchar(100) null
|
2021-04-16 20:44:56 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
create table if not exists tvshow_episodes
|
|
|
|
(
|
|
|
|
id int auto_increment
|
|
|
|
primary key,
|
|
|
|
name varchar(100) null,
|
|
|
|
season int null,
|
|
|
|
poster mediumblob null,
|
|
|
|
tvshow_id int null,
|
2021-04-22 18:31:36 +00:00
|
|
|
episode int null,
|
|
|
|
filename varchar(100) null,
|
2021-04-16 20:44:56 +00:00
|
|
|
constraint tvshow_episodes_tvshow_id_fk
|
|
|
|
foreign key (tvshow_id) references tvshow (id)
|
|
|
|
);
|
|
|
|
|
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,
|
2021-04-22 18:31:36 +00:00
|
|
|
movie_name varchar(200) null,
|
|
|
|
movie_url varchar(250) null,
|
|
|
|
thumbnail mediumblob null,
|
|
|
|
poster mediumblob null,
|
|
|
|
likes int default 0 null,
|
|
|
|
quality int null,
|
|
|
|
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
|
|
|
|
2020-12-11 18:23:13 +00:00
|
|
|
create table if not exists actors_videos
|
|
|
|
(
|
|
|
|
actor_id int null,
|
|
|
|
video_id int null,
|
|
|
|
constraint actors_videos_actors_id_fk
|
2020-12-29 19:39:30 +00:00
|
|
|
foreign key (actor_id) references actors (actor_id),
|
2020-12-11 18:23:13 +00:00
|
|
|
constraint actors_videos_videos_movie_id_fk
|
|
|
|
foreign key (video_id) references videos (movie_id)
|
|
|
|
);
|
|
|
|
|
2021-03-22 17:39:34 +00:00
|
|
|
create index if not exists actors_videos_actor_id_index
|
2020-12-11 18:23:13 +00:00
|
|
|
on actors_videos (actor_id);
|
|
|
|
|
2021-03-22 17:39:34 +00:00
|
|
|
create index if not exists actors_videos_video_id_index
|
2020-12-11 18:23:13 +00:00
|
|
|
on actors_videos (video_id);
|
|
|
|
|
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-07-17 23:10:04 +00:00
|
|
|
|
2020-10-03 23:00:52 +00:00
|
|
|
INSERT IGNORE INTO tags (tag_id, tag_name)
|
2020-06-03 22:15:06 +00:00
|
|
|
VALUES (2, 'fullhd');
|
2020-10-03 23:00:52 +00:00
|
|
|
INSERT IGNORE INTO tags (tag_id, tag_name)
|
2020-06-03 22:15:06 +00:00
|
|
|
VALUES (3, 'lowquality');
|
2020-10-03 23:00:52 +00:00
|
|
|
INSERT IGNORE INTO tags (tag_id, tag_name)
|
2020-06-03 22:15:06 +00:00
|
|
|
VALUES (4, 'hd');
|
2020-07-17 23:10:04 +00:00
|
|
|
|
2020-10-03 23:00:52 +00:00
|
|
|
INSERT IGNORE INTO settings (video_path, episode_path, password, mediacenter_name)
|
2020-07-17 23:10:04 +00:00
|
|
|
VALUES ('./videos/', './tvshows/', -1, 'OpenMediaCenter');
|