-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.sql
52 lines (50 loc) · 866 Bytes
/
init.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
44
45
46
47
48
49
50
51
52
-- create the movies table
CREATE TABLE movies(
id INT PRIMARY KEY,
budget MONEY,
genres JSONB,
homepage TEXT,
keywords JSONB,
original_language TEXT,
original_title TEXT,
title TEXT,
overview TEXT,
popularity FLOAT,
production_companies JSONB,
production_countries JSONB,
release_date DATE,
revenue MONEY,
runtime INT,
spoken_languages JSONB,
status TEXT,
tagline TEXT,
vote_average FLOAT,
vote_count INT
);
SET datestyle TO DMY;
-- import the movies data
COPY movies(
budget,
genres,
homepage,
id,
keywords,
original_language,
original_title,
overview,
popularity,
production_companies,
production_countries,
release_date,
revenue,
runtime,
spoken_languages,
status,
tagline,
title,
vote_average,
vote_count
)
FROM '/docker-entrypoint-initdb.d/movies.csv'
DELIMITER ','
CSV HEADER;