-
Notifications
You must be signed in to change notification settings - Fork 6
/
schema.sql
170 lines (150 loc) · 4.01 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
CREATE TABLE aka_name (
id integer NOT NULL PRIMARY KEY,
person_id integer NOT NULL,
name text NOT NULL,
imdb_index character varying(12),
name_pcode_cf character varying(5),
name_pcode_nf character varying(5),
surname_pcode character varying(5),
md5sum character varying(32)
);
CREATE TABLE aka_title (
id integer NOT NULL PRIMARY KEY,
movie_id integer NOT NULL,
title text NOT NULL,
imdb_index character varying(12),
kind_id integer NOT NULL,
production_year integer,
phonetic_code character varying(5),
episode_of_id integer,
season_nr integer,
episode_nr integer,
note text,
md5sum character varying(32)
);
CREATE TABLE cast_info (
id integer NOT NULL PRIMARY KEY,
person_id integer NOT NULL,
movie_id integer NOT NULL,
person_role_id integer,
note text,
nr_order integer,
role_id integer NOT NULL
);
CREATE TABLE char_name (
id integer NOT NULL PRIMARY KEY,
name text NOT NULL,
imdb_index character varying(12),
imdb_id integer,
name_pcode_nf character varying(5),
surname_pcode character varying(5),
md5sum character varying(32)
);
CREATE TABLE comp_cast_type (
id integer NOT NULL PRIMARY KEY,
kind character varying(32) NOT NULL
);
CREATE TABLE company_name (
id integer NOT NULL PRIMARY KEY,
name text NOT NULL,
country_code character varying(255),
imdb_id integer,
name_pcode_nf character varying(5),
name_pcode_sf character varying(5),
md5sum character varying(32)
);
CREATE TABLE company_type (
id integer NOT NULL PRIMARY KEY,
kind character varying(32) NOT NULL
);
CREATE TABLE complete_cast (
id integer NOT NULL PRIMARY KEY,
movie_id integer,
subject_id integer NOT NULL,
status_id integer NOT NULL
);
CREATE TABLE info_type (
id integer NOT NULL PRIMARY KEY,
info character varying(32) NOT NULL
);
CREATE TABLE keyword (
id integer NOT NULL PRIMARY KEY,
keyword text NOT NULL,
phonetic_code character varying(5)
);
CREATE TABLE kind_type (
id integer NOT NULL PRIMARY KEY,
kind character varying(15) NOT NULL
);
CREATE TABLE link_type (
id integer NOT NULL PRIMARY KEY,
link character varying(32) NOT NULL
);
CREATE TABLE movie_companies (
id integer NOT NULL PRIMARY KEY,
movie_id integer NOT NULL,
company_id integer NOT NULL,
company_type_id integer NOT NULL,
note text
);
CREATE TABLE movie_info (
id integer NOT NULL PRIMARY KEY,
movie_id integer NOT NULL,
info_type_id integer NOT NULL,
info text NOT NULL,
note text
);
CREATE TABLE movie_info_idx (
id integer NOT NULL PRIMARY KEY,
movie_id integer NOT NULL,
info_type_id integer NOT NULL,
info text NOT NULL,
note text
);
CREATE TABLE movie_keyword (
id integer NOT NULL PRIMARY KEY,
movie_id integer NOT NULL,
keyword_id integer NOT NULL
);
CREATE TABLE movie_link (
id integer NOT NULL PRIMARY KEY,
movie_id integer NOT NULL,
linked_movie_id integer NOT NULL,
link_type_id integer NOT NULL
);
CREATE TABLE name (
id integer NOT NULL PRIMARY KEY,
name text NOT NULL,
imdb_index character varying(12),
imdb_id integer,
gender character varying(1),
name_pcode_cf character varying(5),
name_pcode_nf character varying(5),
surname_pcode character varying(5),
md5sum character varying(32)
);
CREATE TABLE person_info (
id integer NOT NULL PRIMARY KEY,
person_id integer NOT NULL,
info_type_id integer NOT NULL,
info text NOT NULL,
note text
);
CREATE TABLE role_type (
id integer NOT NULL PRIMARY KEY,
role character varying(32) NOT NULL
);
CREATE TABLE title (
id integer NOT NULL PRIMARY KEY,
title text NOT NULL,
imdb_index character varying(12),
kind_id integer NOT NULL,
production_year integer,
imdb_id integer,
phonetic_code character varying(5),
episode_of_id integer,
season_nr integer,
episode_nr integer,
series_years character varying(49),
md5sum character varying(32)
);