-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
43 lines (38 loc) · 874 Bytes
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- DO NOT MODIFY THIS FILE. IT IS ONLY USED BY THE TEST DATABASE.
CREATE TABLE actors (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
created_at TIMESTAMP,
update_at TIMESTAMP
);
CREATE TABLE cast_members (
id SERIAL PRIMARY KEY,
movie_id INTEGER NOT NULL,
actor_id INTEGER NOT NULL,
created_at TIMESTAMP,
update_at TIMESTAMP,
character VARCHAR(255)
);
CREATE TABLE movies (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
year INTEGER NOT NULL,
synopsis TEXT,
rating INTEGER,
created_at TIMESTAMP,
update_at TIMESTAMP,
genre_id INTEGER NOT NULL,
studio_id INTEGER
);
CREATE TABLE genres (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
created_at TIMESTAMP,
update_at TIMESTAMP
);
CREATE TABLE studios (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
created_at TIMESTAMP,
update_at TIMESTAMP
);