Commit | Line | Data |
0009fa49 |
1 | -- |
2 | -- Created by SQL::Translator::Producer::SQLite |
77211009 |
3 | -- Created on Tue Aug 8 01:53:20 2006 |
0009fa49 |
4 | -- |
5 | BEGIN TRANSACTION; |
6 | |
7 | -- |
38e48163 |
8 | -- Table: employee |
4e298a80 |
9 | -- |
38e48163 |
10 | CREATE TABLE employee ( |
4e298a80 |
11 | employee_id INTEGER PRIMARY KEY NOT NULL, |
12 | position integer NOT NULL, |
13 | group_id integer, |
1d941d67 |
14 | group_id_2 integer, |
4e298a80 |
15 | name varchar(100) |
16 | ); |
17 | |
18 | -- |
8fcf21b3 |
19 | -- Table: serialized |
20 | -- |
21 | CREATE TABLE serialized ( |
22 | id INTEGER PRIMARY KEY NOT NULL, |
23 | serialized text NOT NULL |
24 | ); |
25 | |
26 | -- |
8fcf21b3 |
27 | -- Table: liner_notes |
28 | -- |
29 | CREATE TABLE liner_notes ( |
30 | liner_id INTEGER PRIMARY KEY NOT NULL, |
31 | notes varchar(100) NOT NULL |
32 | ); |
33 | |
34 | -- |
0009fa49 |
35 | -- Table: cd_to_producer |
36 | -- |
37 | CREATE TABLE cd_to_producer ( |
38 | cd integer NOT NULL, |
39 | producer integer NOT NULL, |
40 | PRIMARY KEY (cd, producer) |
41 | ); |
42 | |
43 | -- |
44 | -- Table: artist |
45 | -- |
46 | CREATE TABLE artist ( |
47 | artistid INTEGER PRIMARY KEY NOT NULL, |
8fcf21b3 |
48 | name varchar(100) |
0009fa49 |
49 | ); |
50 | |
51 | -- |
9c2c91ea |
52 | -- Table: twokeytreelike |
53 | -- |
54 | CREATE TABLE twokeytreelike ( |
55 | id1 integer NOT NULL, |
56 | id2 integer NOT NULL, |
57 | parent1 integer NOT NULL, |
58 | parent2 integer NOT NULL, |
59 | name varchar(100) NOT NULL, |
60 | PRIMARY KEY (id1, id2) |
61 | ); |
62 | |
63 | -- |
3bd6e3e0 |
64 | -- Table: fourkeys_to_twokeys |
65 | -- |
66 | CREATE TABLE fourkeys_to_twokeys ( |
67 | f_foo integer NOT NULL, |
68 | f_bar integer NOT NULL, |
69 | f_hello integer NOT NULL, |
70 | f_goodbye integer NOT NULL, |
71 | t_artist integer NOT NULL, |
72 | t_cd integer NOT NULL, |
73 | autopilot character NOT NULL, |
74 | PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd) |
75 | ); |
76 | |
77 | -- |
0009fa49 |
78 | -- Table: self_ref_alias |
79 | -- |
80 | CREATE TABLE self_ref_alias ( |
81 | self_ref integer NOT NULL, |
887ce227 |
82 | alias integer NOT NULL, |
83 | PRIMARY KEY (self_ref, alias) |
0009fa49 |
84 | ); |
85 | |
86 | -- |
0009fa49 |
87 | -- Table: cd |
88 | -- |
89 | CREATE TABLE cd ( |
90 | cdid INTEGER PRIMARY KEY NOT NULL, |
91 | artist integer NOT NULL, |
8fcf21b3 |
92 | title varchar(100) NOT NULL, |
93 | year varchar(100) NOT NULL |
0009fa49 |
94 | ); |
95 | |
96 | -- |
9c2c91ea |
97 | -- Table: bookmark |
0009fa49 |
98 | -- |
9c2c91ea |
99 | CREATE TABLE bookmark ( |
0009fa49 |
100 | id INTEGER PRIMARY KEY NOT NULL, |
9c2c91ea |
101 | link integer NOT NULL |
0009fa49 |
102 | ); |
103 | |
104 | -- |
105 | -- Table: track |
106 | -- |
107 | CREATE TABLE track ( |
108 | trackid INTEGER PRIMARY KEY NOT NULL, |
109 | cd integer NOT NULL, |
110 | position integer NOT NULL, |
43556c5d |
111 | title varchar(100) NOT NULL, |
112 | last_updated_on datetime NULL |
0009fa49 |
113 | ); |
114 | |
115 | -- |
3bd6e3e0 |
116 | -- Table: self_ref |
887ce227 |
117 | -- |
3bd6e3e0 |
118 | CREATE TABLE self_ref ( |
887ce227 |
119 | id INTEGER PRIMARY KEY NOT NULL, |
8fcf21b3 |
120 | name varchar(100) NOT NULL |
887ce227 |
121 | ); |
122 | |
9fcda149 |
123 | -- |
ab8481f5 |
124 | -- Table: link |
125 | -- |
126 | CREATE TABLE link ( |
127 | id INTEGER PRIMARY KEY NOT NULL, |
128 | url varchar(100), |
129 | title varchar(100) |
130 | ); |
131 | |
132 | -- |
4740bdb7 |
133 | -- Table: file_columns |
134 | -- |
135 | CREATE TABLE file_columns ( |
136 | id INTEGER PRIMARY KEY NOT NULL, |
137 | file varchar(255) |
138 | ); |
139 | |
140 | -- |
77211009 |
141 | -- Table: tags |
142 | -- |
143 | CREATE TABLE tags ( |
144 | tagid INTEGER PRIMARY KEY NOT NULL, |
145 | cd integer NOT NULL, |
146 | tag varchar(100) NOT NULL |
147 | ); |
148 | |
149 | -- |
9c2c91ea |
150 | -- Table: treelike |
151 | -- |
152 | CREATE TABLE treelike ( |
153 | id INTEGER PRIMARY KEY NOT NULL, |
61177e44 |
154 | parent integer NULL, |
8fcf21b3 |
155 | name varchar(100) NOT NULL |
0009fa49 |
156 | ); |
157 | |
158 | -- |
f86fcf0d |
159 | -- Table: event |
0009fa49 |
160 | -- |
f86fcf0d |
161 | CREATE TABLE event ( |
162 | id INTEGER PRIMARY KEY NOT NULL, |
c03ccdbc |
163 | starts_at datetime NOT NULL, |
164 | created_on timestamp NOT NULL |
0009fa49 |
165 | ); |
166 | |
887ce227 |
167 | -- |
9c2c91ea |
168 | -- Table: twokeys |
887ce227 |
169 | -- |
9c2c91ea |
170 | CREATE TABLE twokeys ( |
171 | artist integer NOT NULL, |
172 | cd integer NOT NULL, |
173 | PRIMARY KEY (artist, cd) |
174 | ); |
175 | |
176 | -- |
89034887 |
177 | -- Table: noprimarykey |
178 | -- |
179 | CREATE TABLE noprimarykey ( |
180 | foo integer NOT NULL, |
181 | bar integer NOT NULL, |
182 | baz integer NOT NULL |
183 | ); |
184 | |
185 | -- |
9c2c91ea |
186 | -- Table: fourkeys |
187 | -- |
188 | CREATE TABLE fourkeys ( |
189 | foo integer NOT NULL, |
190 | bar integer NOT NULL, |
191 | hello integer NOT NULL, |
192 | goodbye integer NOT NULL, |
3bd6e3e0 |
193 | sensors character NOT NULL, |
9c2c91ea |
194 | PRIMARY KEY (foo, bar, hello, goodbye) |
195 | ); |
196 | |
197 | -- |
198 | -- Table: artist_undirected_map |
199 | -- |
200 | CREATE TABLE artist_undirected_map ( |
201 | id1 integer NOT NULL, |
202 | id2 integer NOT NULL, |
203 | PRIMARY KEY (id1, id2) |
204 | ); |
205 | |
206 | -- |
207 | -- Table: producer |
208 | -- |
209 | CREATE TABLE producer ( |
210 | producerid INTEGER PRIMARY KEY NOT NULL, |
8fcf21b3 |
211 | name varchar(100) NOT NULL |
887ce227 |
212 | ); |
213 | |
9fcda149 |
214 | -- |
9c2c91ea |
215 | -- Table: onekey |
9fcda149 |
216 | -- |
9c2c91ea |
217 | CREATE TABLE onekey ( |
8fcf21b3 |
218 | id INTEGER PRIMARY KEY NOT NULL, |
9c2c91ea |
219 | artist integer NOT NULL, |
220 | cd integer NOT NULL |
9fcda149 |
221 | ); |
222 | |
78060df8 |
223 | -- |
224 | -- Table: typed_object |
225 | -- |
226 | CREATE TABLE typed_object ( |
227 | objectid INTEGER PRIMARY KEY NOT NULL, |
228 | type VARCHAR(100) NOT NULL, |
229 | value VARCHAR(100) |
230 | ); |
231 | |
232 | -- |
233 | -- Table: collection |
234 | -- |
235 | CREATE TABLE collection ( |
236 | collectionid INTEGER PRIMARY KEY NOT NULL, |
237 | name VARCHAR(100) |
238 | ); |
239 | |
240 | -- |
241 | -- Table: collection_object |
242 | -- |
243 | CREATE TABLE collection_object ( |
244 | collection INTEGER NOT NULL, |
245 | object INTEGER NOT NULL |
246 | ); |
247 | |
248 | -- |
249 | -- Table: owners |
250 | -- |
251 | CREATE TABLE owners ( |
252 | ownerid INTEGER PRIMARY KEY NOT NULL, |
253 | name varchar(100) |
254 | ); |
255 | |
256 | -- |
257 | -- Table: books |
258 | -- |
259 | CREATE TABLE books ( |
260 | id INTEGER PRIMARY KEY NOT NULL, |
261 | owner INTEGER, |
262 | source varchar(100), |
263 | title varchar(100) |
264 | ); |
265 | |
266 | |
38e48163 |
267 | CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name); |
368a5228 |
268 | CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title); |
365d06b7 |
269 | CREATE UNIQUE INDEX track_cd_position_track on track (cd, position); |
270 | CREATE UNIQUE INDEX track_cd_title_track on track (cd, title); |
89034887 |
271 | CREATE UNIQUE INDEX foo_bar_noprimarykey on noprimarykey (foo, bar); |
368a5228 |
272 | CREATE UNIQUE INDEX prod_name_producer on producer (name); |
0009fa49 |
273 | COMMIT; |