RestApiv2/migrates/20221213130458_films.up.sql

41 lines
900 B
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(1500),
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 tokens (
userID INTEGER NOT NULL,
refreshToken TEXT NOT NULL
);