RestApiv2/migrates/20221213130458_films.up.sql

69 lines
1.6 KiB
SQL

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),
media JSON,
PRIMARY KEY(id)
);
CREATE TABLE users (
id SERIAL,
login TEXT not NULL,
email TEXT NOT NULL,
password TEXT NOT NULL,
avatar_url TEXT,
permisionLVL INTEGER NOT NULL,
SaveItem INTEGER Array,
LaterItem INTEGER Array,
WantItem INTEGER Array,
PRIMARY KEY(id)
);
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)
);
CREATE TABLE tokens (
login TEXT NOT NULL,
refreshToken TEXT NOT NULL,
PRIMARY KEY(login)
);