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