Commit | Line | Data |
0009fa49 |
1 | -- |
2 | -- Created by SQL::Translator::Producer::SQLite |
6bf6ba2f |
3 | -- Created on Mon Nov 10 23:52:55 2008 |
0009fa49 |
4 | -- |
5 | BEGIN TRANSACTION; |
6 | |
0009fa49 |
7 | |
8 | -- |
9 | -- Table: artist |
10 | -- |
11 | CREATE TABLE artist ( |
12 | artistid INTEGER PRIMARY KEY NOT NULL, |
39da2a2b |
13 | name varchar(100), |
a0dd8679 |
14 | rank integer NOT NULL DEFAULT '13', |
15 | charfield char(10) |
0009fa49 |
16 | ); |
17 | |
ebf846e8 |
18 | |
0009fa49 |
19 | -- |
ebf846e8 |
20 | -- Table: artist_undirected_map |
9c2c91ea |
21 | -- |
ebf846e8 |
22 | CREATE TABLE artist_undirected_map ( |
9c2c91ea |
23 | id1 integer NOT NULL, |
24 | id2 integer NOT NULL, |
9c2c91ea |
25 | PRIMARY KEY (id1, id2) |
26 | ); |
27 | |
ebf846e8 |
28 | CREATE INDEX artist_undirected_map_idx_id1_ ON artist_undirected_map (id1); |
29 | CREATE INDEX artist_undirected_map_idx_id2_ ON artist_undirected_map (id2); |
30 | |
9c2c91ea |
31 | -- |
ebf846e8 |
32 | -- Table: bookmark |
3bd6e3e0 |
33 | -- |
ebf846e8 |
34 | CREATE TABLE bookmark ( |
35 | id INTEGER PRIMARY KEY NOT NULL, |
36 | link integer NOT NULL |
3bd6e3e0 |
37 | ); |
38 | |
ebf846e8 |
39 | CREATE INDEX bookmark_idx_link_bookmark ON bookmark (link); |
40 | |
3bd6e3e0 |
41 | -- |
ebf846e8 |
42 | -- Table: books |
0009fa49 |
43 | -- |
ebf846e8 |
44 | CREATE TABLE books ( |
45 | id INTEGER PRIMARY KEY NOT NULL, |
46 | source varchar(100) NOT NULL, |
47 | owner integer NOT NULL, |
cda5e082 |
48 | title varchar(100) NOT NULL, |
49 | price integer |
0009fa49 |
50 | ); |
51 | |
ebf846e8 |
52 | |
0009fa49 |
53 | -- |
0009fa49 |
54 | -- Table: cd |
55 | -- |
56 | CREATE TABLE cd ( |
57 | cdid INTEGER PRIMARY KEY NOT NULL, |
58 | artist integer NOT NULL, |
8fcf21b3 |
59 | title varchar(100) NOT NULL, |
370f2ba2 |
60 | year varchar(100) NOT NULL, |
61 | genreid integer |
62 | ); |
63 | |
ebf846e8 |
64 | CREATE INDEX cd_idx_artist_cd ON cd (artist); |
65 | CREATE INDEX cd_idx_genreid_cd ON cd (genreid); |
66 | CREATE UNIQUE INDEX cd_artist_title_cd ON cd (artist, title); |
67 | |
370f2ba2 |
68 | -- |
ebf846e8 |
69 | -- Table: cd_to_producer |
370f2ba2 |
70 | -- |
ebf846e8 |
71 | CREATE TABLE cd_to_producer ( |
72 | cd integer NOT NULL, |
73 | producer integer NOT NULL, |
74 | PRIMARY KEY (cd, producer) |
0009fa49 |
75 | ); |
76 | |
ebf846e8 |
77 | CREATE INDEX cd_to_producer_idx_cd_cd_to_pr ON cd_to_producer (cd); |
78 | CREATE INDEX cd_to_producer_idx_producer_cd ON cd_to_producer (producer); |
79 | |
0009fa49 |
80 | -- |
ebf846e8 |
81 | -- Table: collection |
0009fa49 |
82 | -- |
ebf846e8 |
83 | CREATE TABLE collection ( |
84 | collectionid INTEGER PRIMARY KEY NOT NULL, |
85 | name varchar(100) NOT NULL |
0009fa49 |
86 | ); |
87 | |
ebf846e8 |
88 | |
0009fa49 |
89 | -- |
ebf846e8 |
90 | -- Table: collection_object |
0009fa49 |
91 | -- |
ebf846e8 |
92 | CREATE TABLE collection_object ( |
93 | collection integer NOT NULL, |
94 | object integer NOT NULL, |
95 | PRIMARY KEY (collection, object) |
0009fa49 |
96 | ); |
97 | |
ebf846e8 |
98 | CREATE INDEX collection_object_idx_collection_collection_obj ON collection_object (collection); |
99 | CREATE INDEX collection_object_idx_object_c ON collection_object (object); |
100 | |
0009fa49 |
101 | -- |
ebf846e8 |
102 | -- Table: employee |
887ce227 |
103 | -- |
ebf846e8 |
104 | CREATE TABLE employee ( |
105 | employee_id INTEGER PRIMARY KEY NOT NULL, |
106 | position integer NOT NULL, |
107 | group_id integer, |
108 | group_id_2 integer, |
109 | name varchar(100) |
887ce227 |
110 | ); |
111 | |
ebf846e8 |
112 | |
9fcda149 |
113 | -- |
ebf846e8 |
114 | -- Table: event |
ab8481f5 |
115 | -- |
ebf846e8 |
116 | CREATE TABLE event ( |
ab8481f5 |
117 | id INTEGER PRIMARY KEY NOT NULL, |
ebf846e8 |
118 | starts_at datetime NOT NULL, |
a97fe7e0 |
119 | created_on timestamp NOT NULL, |
120 | varchar_date varchar(20), |
ff8a6e3b |
121 | varchar_datetime varchar(20), |
a0dd8679 |
122 | skip_inflation datetime |
ab8481f5 |
123 | ); |
124 | |
ebf846e8 |
125 | |
ab8481f5 |
126 | -- |
4740bdb7 |
127 | -- Table: file_columns |
128 | -- |
129 | CREATE TABLE file_columns ( |
130 | id INTEGER PRIMARY KEY NOT NULL, |
ebf846e8 |
131 | file varchar(255) NOT NULL |
4740bdb7 |
132 | ); |
133 | |
ebf846e8 |
134 | |
4740bdb7 |
135 | -- |
ebf846e8 |
136 | -- Table: forceforeign |
77211009 |
137 | -- |
ebf846e8 |
138 | CREATE TABLE forceforeign ( |
139 | artist INTEGER PRIMARY KEY NOT NULL, |
140 | cd integer NOT NULL |
77211009 |
141 | ); |
142 | |
ebf846e8 |
143 | CREATE INDEX forceforeign_idx_artist_forcef ON forceforeign (artist); |
144 | |
77211009 |
145 | -- |
ebf846e8 |
146 | -- Table: fourkeys |
9c2c91ea |
147 | -- |
ebf846e8 |
148 | CREATE TABLE fourkeys ( |
149 | foo integer NOT NULL, |
150 | bar integer NOT NULL, |
151 | hello integer NOT NULL, |
152 | goodbye integer NOT NULL, |
153 | sensors character NOT NULL, |
154 | PRIMARY KEY (foo, bar, hello, goodbye) |
0009fa49 |
155 | ); |
156 | |
ebf846e8 |
157 | |
0009fa49 |
158 | -- |
ebf846e8 |
159 | -- Table: fourkeys_to_twokeys |
0009fa49 |
160 | -- |
ebf846e8 |
161 | CREATE TABLE fourkeys_to_twokeys ( |
162 | f_foo integer NOT NULL, |
163 | f_bar integer NOT NULL, |
164 | f_hello integer NOT NULL, |
165 | f_goodbye integer NOT NULL, |
166 | t_artist integer NOT NULL, |
167 | t_cd integer NOT NULL, |
168 | autopilot character NOT NULL, |
169 | PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd) |
0009fa49 |
170 | ); |
171 | |
ebf846e8 |
172 | CREATE INDEX fourkeys_to_twokeys_idx_f_foo_f_bar_f_hello_f_goodbye_ ON fourkeys_to_twokeys (f_foo, f_bar, f_hello, f_goodbye); |
173 | CREATE INDEX fourkeys_to_twokeys_idx_t_artist_t_cd_fourkeys_to ON fourkeys_to_twokeys (t_artist, t_cd); |
174 | |
887ce227 |
175 | -- |
ebf846e8 |
176 | -- Table: genre |
887ce227 |
177 | -- |
ebf846e8 |
178 | CREATE TABLE genre ( |
87310237 |
179 | genreid INTEGER PRIMARY KEY NOT NULL, |
180 | name varchar(100) NOT NULL |
9c2c91ea |
181 | ); |
182 | |
87310237 |
183 | CREATE UNIQUE INDEX genre_name_genre ON genre (name); |
ebf846e8 |
184 | |
185 | -- |
186 | -- Table: liner_notes |
187 | -- |
188 | CREATE TABLE liner_notes ( |
189 | liner_id INTEGER PRIMARY KEY NOT NULL, |
190 | notes varchar(100) NOT NULL |
191 | ); |
192 | |
6bf6ba2f |
193 | CREATE INDEX liner_notes_idx_liner_id_liner ON liner_notes (liner_id); |
ebf846e8 |
194 | |
195 | -- |
196 | -- Table: link |
197 | -- |
198 | CREATE TABLE link ( |
199 | id INTEGER PRIMARY KEY NOT NULL, |
200 | url varchar(100), |
201 | title varchar(100) |
202 | ); |
203 | |
204 | |
9c2c91ea |
205 | -- |
89034887 |
206 | -- Table: noprimarykey |
207 | -- |
208 | CREATE TABLE noprimarykey ( |
209 | foo integer NOT NULL, |
210 | bar integer NOT NULL, |
211 | baz integer NOT NULL |
212 | ); |
213 | |
ebf846e8 |
214 | CREATE UNIQUE INDEX foo_bar_noprimarykey ON noprimarykey (foo, bar); |
215 | |
89034887 |
216 | -- |
ebf846e8 |
217 | -- Table: onekey |
9c2c91ea |
218 | -- |
ebf846e8 |
219 | CREATE TABLE onekey ( |
220 | id INTEGER PRIMARY KEY NOT NULL, |
221 | artist integer NOT NULL, |
222 | cd integer NOT NULL |
9c2c91ea |
223 | ); |
224 | |
ebf846e8 |
225 | |
9c2c91ea |
226 | -- |
ebf846e8 |
227 | -- Table: owners |
9c2c91ea |
228 | -- |
ebf846e8 |
229 | CREATE TABLE owners ( |
230 | ownerid INTEGER PRIMARY KEY NOT NULL, |
231 | name varchar(100) NOT NULL |
9c2c91ea |
232 | ); |
233 | |
ebf846e8 |
234 | |
9c2c91ea |
235 | -- |
236 | -- Table: producer |
237 | -- |
238 | CREATE TABLE producer ( |
239 | producerid INTEGER PRIMARY KEY NOT NULL, |
8fcf21b3 |
240 | name varchar(100) NOT NULL |
887ce227 |
241 | ); |
242 | |
ebf846e8 |
243 | CREATE UNIQUE INDEX prod_name_producer ON producer (name); |
244 | |
9fcda149 |
245 | -- |
ebf846e8 |
246 | -- Table: self_ref |
9fcda149 |
247 | -- |
ebf846e8 |
248 | CREATE TABLE self_ref ( |
8fcf21b3 |
249 | id INTEGER PRIMARY KEY NOT NULL, |
ebf846e8 |
250 | name varchar(100) NOT NULL |
9fcda149 |
251 | ); |
252 | |
ebf846e8 |
253 | |
78060df8 |
254 | -- |
ebf846e8 |
255 | -- Table: self_ref_alias |
78060df8 |
256 | -- |
ebf846e8 |
257 | CREATE TABLE self_ref_alias ( |
258 | self_ref integer NOT NULL, |
259 | alias integer NOT NULL, |
260 | PRIMARY KEY (self_ref, alias) |
78060df8 |
261 | ); |
262 | |
ebf846e8 |
263 | CREATE INDEX self_ref_alias_idx_alias_self_ ON self_ref_alias (alias); |
264 | CREATE INDEX self_ref_alias_idx_self_ref_se ON self_ref_alias (self_ref); |
265 | |
78060df8 |
266 | -- |
ebf846e8 |
267 | -- Table: sequence_test |
78060df8 |
268 | -- |
ebf846e8 |
269 | CREATE TABLE sequence_test ( |
270 | pkid1 integer NOT NULL, |
271 | pkid2 integer NOT NULL, |
272 | nonpkid integer NOT NULL, |
273 | name varchar(100), |
274 | PRIMARY KEY (pkid1, pkid2) |
78060df8 |
275 | ); |
276 | |
ebf846e8 |
277 | |
78060df8 |
278 | -- |
ebf846e8 |
279 | -- Table: serialized |
78060df8 |
280 | -- |
ebf846e8 |
281 | CREATE TABLE serialized ( |
282 | id INTEGER PRIMARY KEY NOT NULL, |
283 | serialized text NOT NULL |
78060df8 |
284 | ); |
285 | |
ebf846e8 |
286 | |
78060df8 |
287 | -- |
ebf846e8 |
288 | -- Table: tags |
78060df8 |
289 | -- |
ebf846e8 |
290 | CREATE TABLE tags ( |
291 | tagid INTEGER PRIMARY KEY NOT NULL, |
292 | cd integer NOT NULL, |
293 | tag varchar(100) NOT NULL |
78060df8 |
294 | ); |
295 | |
ebf846e8 |
296 | CREATE INDEX tags_idx_cd_tags ON tags (cd); |
297 | |
78060df8 |
298 | -- |
ebf846e8 |
299 | -- Table: track |
78060df8 |
300 | -- |
ebf846e8 |
301 | CREATE TABLE track ( |
302 | trackid INTEGER PRIMARY KEY NOT NULL, |
303 | cd integer NOT NULL, |
304 | position integer NOT NULL, |
305 | title varchar(100) NOT NULL, |
306 | last_updated_on datetime |
307 | ); |
308 | |
309 | CREATE INDEX track_idx_cd_track ON track (cd); |
310 | CREATE UNIQUE INDEX track_cd_position_track ON track (cd, position); |
311 | CREATE UNIQUE INDEX track_cd_title_track ON track (cd, title); |
312 | |
313 | -- |
314 | -- Table: treelike |
315 | -- |
316 | CREATE TABLE treelike ( |
78060df8 |
317 | id INTEGER PRIMARY KEY NOT NULL, |
ebf846e8 |
318 | parent integer, |
319 | name varchar(100) NOT NULL |
320 | ); |
321 | |
322 | CREATE INDEX treelike_idx_parent_treelike ON treelike (parent); |
323 | |
324 | -- |
325 | -- Table: twokeytreelike |
326 | -- |
327 | CREATE TABLE twokeytreelike ( |
328 | id1 integer NOT NULL, |
329 | id2 integer NOT NULL, |
330 | parent1 integer NOT NULL, |
331 | parent2 integer NOT NULL, |
332 | name varchar(100) NOT NULL, |
333 | PRIMARY KEY (id1, id2) |
334 | ); |
335 | |
336 | CREATE INDEX twokeytreelike_idx_parent1_parent2_twokeytre ON twokeytreelike (parent1, parent2); |
337 | CREATE UNIQUE INDEX tktlnameunique_twokeytreelike ON twokeytreelike (name); |
338 | |
339 | -- |
340 | -- Table: twokeys |
341 | -- |
342 | CREATE TABLE twokeys ( |
343 | artist integer NOT NULL, |
344 | cd integer NOT NULL, |
345 | PRIMARY KEY (artist, cd) |
346 | ); |
347 | |
348 | CREATE INDEX twokeys_idx_artist_twokeys ON twokeys (artist); |
349 | |
350 | -- |
351 | -- Table: typed_object |
352 | -- |
353 | CREATE TABLE typed_object ( |
354 | objectid INTEGER PRIMARY KEY NOT NULL, |
355 | type varchar(100) NOT NULL, |
356 | value varchar(100) NOT NULL |
78060df8 |
357 | ); |
358 | |
359 | |
0009fa49 |
360 | COMMIT; |