RestApiv2/migrates/20221213130458_films.up.sql

68 lines
1.5 KiB
MySQL
Raw Permalink Normal View History

2022-12-13 16:45:22 +03:00
CREATE TABLE films (
id INTEGER NOT NULL,
ru_title VARCHAR(256),
orig_title VARCHAR(255),
imdb_id VARCHAR(255),
kinopoisk_id INTEGER,
posterUrl VARCHAR(1500),
posterUrlPreview VARCHAR(1500),
countries JSON,
genres JSON,
year INTEGER,
description VARCHAR(20000),
ratingKinopoisk INTEGER,
ratingImdb INTEGER,
iframe_src VARCHAR(2000),
ratingImdbVoteCount INTEGER,
ratingKinopoiskVoteCount INTEGER,
created VARCHAR(1000),
content_type VARCHAR(25),
ratingAgeLimits VARCHAR(25),
2022-12-13 16:45:22 +03:00
media JSON,
PRIMARY KEY(id)
);
2023-03-15 22:44:31 +03:00
2023-03-15 22:44:31 +03:00
CREATE TABLE users (
2023-04-14 17:35:25 +03:00
id SERIAL,
login TEXT not NULL,
email TEXT NOT NULL,
password TEXT NOT NULL,
avatar_url TEXT,
2023-03-15 22:44:31 +03:00
permisionLVL INTEGER NOT NULL,
SaveItemFilms INTEGER Array,
SaveItemSiries INTEGER Array,
2023-03-15 22:44:31 +03:00
PRIMARY KEY(id)
);
2023-04-14 17:35:25 +03:00
CREATE TABLE Siries (
id INTEGER NOT NULL,
ru_title VARCHAR(256),
orig_title VARCHAR(255),
imdb_id VARCHAR(255),
kinopoisk_id INTEGER,
posterUrl VARCHAR(1500),
posterUrlPreview VARCHAR(1500),
countries JSON,
genres JSON,
year INTEGER,
description VARCHAR(20000),
ratingKinopoisk INTEGER,
ratingImdb INTEGER,
iframe_src VARCHAR(2000),
ratingImdbVoteCount INTEGER,
ratingKinopoiskVoteCount INTEGER,
created VARCHAR(1000),
content_type VARCHAR(25),
ratingAgeLimits VARCHAR(25),
translation JSON,
episodes JSON,
PRIMARY KEY(id)
);
2023-04-14 17:35:25 +03:00
CREATE TABLE tokens (
login TEXT NOT NULL,
refreshToken TEXT NOT NULL,
PRIMARY KEY(login)
2023-04-14 17:35:25 +03:00
);