Files
OpenMediaCenter/database.sql
T

52 lines
1.7 KiB
SQL
Raw Normal View History

2020-05-24 11:49:37 +02:00
create table if not exists tags
(
tag_id int auto_increment
primary key,
tag_name varchar(50) null
);
2020-05-23 23:47:15 +02:00
create table if not exists videos
(
2020-05-24 11:49:37 +02:00
movie_id int auto_increment
2020-05-23 23:47:15 +02:00
primary key,
2020-05-24 11:49:37 +02:00
movie_name varchar(200) null,
2020-06-03 12:26:10 +02:00
movie_url varchar(250) null,
2020-05-24 11:49:37 +02:00
thumbnail mediumblob null,
2020-06-04 00:15:06 +02:00
poster mediumblob null,
2020-05-24 11:49:37 +02:00
likes int default 0 null,
2020-06-03 12:26:10 +02:00
quality int null,
2020-06-04 00:15:06 +02:00
length int null comment 'in seconds',
create_date datetime default CURRENT_TIMESTAMP null
2020-05-23 23:47:15 +02:00
);
2020-05-24 11:49:37 +02: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 12:26:10 +02:00
);
2020-06-04 00:15:06 +02:00
2020-10-03 20:28:19 +00:00
create table if not exists settings
(
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 18:17:17 +02:00
TMDB_grabbing tinyint null,
DarkMode tinyint default 0 null
);
2020-06-04 00:15:06 +02: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');
INSERT INTO settings (video_path, episode_path, password, mediacenter_name)
VALUES ('./videos/', './tvshows/', -1, 'OpenMediaCenter');