backporting the set_column/store_column fix
[dbsrgits/DBIx-Class.git] / t / lib / sqlite.sql
CommitLineData
0009fa49 1--
2-- Created by SQL::Translator::Producer::SQLite
6ec7d1bb 3-- Created on Sat Jan 17 19:40:47 2009
0009fa49 4--
5BEGIN TRANSACTION;
6
0009fa49 7
8--
9-- Table: artist
10--
11CREATE 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 22CREATE TABLE artist_undirected_map (
9c2c91ea 23 id1 integer NOT NULL,
24 id2 integer NOT NULL,
9c2c91ea 25 PRIMARY KEY (id1, id2)
26);
27
ebf846e8 28CREATE INDEX artist_undirected_map_idx_id1_ ON artist_undirected_map (id1);
29CREATE INDEX artist_undirected_map_idx_id2_ ON artist_undirected_map (id2);
30
9c2c91ea 31--
4f6386b0 32-- Table: cd_artwork
33--
34CREATE TABLE cd_artwork (
35 cd_id INTEGER PRIMARY KEY NOT NULL
36);
37
38CREATE INDEX cd_artwork_idx_cd_id_cd_artwor ON cd_artwork (cd_id);
39
40--
6ec7d1bb 41-- Table: bindtype_test
42--
43CREATE TABLE bindtype_test (
44 id INTEGER PRIMARY KEY NOT NULL,
45 bytea blob,
46 blob blob,
47 clob clob
48);
49
50
51--
ebf846e8 52-- Table: bookmark
3bd6e3e0 53--
ebf846e8 54CREATE TABLE bookmark (
55 id INTEGER PRIMARY KEY NOT NULL,
56 link integer NOT NULL
3bd6e3e0 57);
58
ebf846e8 59CREATE INDEX bookmark_idx_link_bookmark ON bookmark (link);
60
3bd6e3e0 61--
ebf846e8 62-- Table: books
0009fa49 63--
ebf846e8 64CREATE TABLE books (
65 id INTEGER PRIMARY KEY NOT NULL,
66 source varchar(100) NOT NULL,
67 owner integer NOT NULL,
cda5e082 68 title varchar(100) NOT NULL,
69 price integer
0009fa49 70);
71
ebf846e8 72
0009fa49 73--
0009fa49 74-- Table: cd
75--
76CREATE TABLE cd (
77 cdid INTEGER PRIMARY KEY NOT NULL,
78 artist integer NOT NULL,
8fcf21b3 79 title varchar(100) NOT NULL,
370f2ba2 80 year varchar(100) NOT NULL,
a1cb5921 81 genreid integer,
82 single_track integer
370f2ba2 83);
84
ebf846e8 85CREATE INDEX cd_idx_artist_cd ON cd (artist);
86CREATE INDEX cd_idx_genreid_cd ON cd (genreid);
a1cb5921 87CREATE INDEX cd_idx_single_track_cd ON cd (single_track);
ebf846e8 88CREATE UNIQUE INDEX cd_artist_title_cd ON cd (artist, title);
89
370f2ba2 90--
ebf846e8 91-- Table: cd_to_producer
370f2ba2 92--
ebf846e8 93CREATE TABLE cd_to_producer (
94 cd integer NOT NULL,
95 producer integer NOT NULL,
96 PRIMARY KEY (cd, producer)
0009fa49 97);
98
ebf846e8 99CREATE INDEX cd_to_producer_idx_cd_cd_to_pr ON cd_to_producer (cd);
100CREATE INDEX cd_to_producer_idx_producer_cd ON cd_to_producer (producer);
101
0009fa49 102--
ebf846e8 103-- Table: collection
0009fa49 104--
ebf846e8 105CREATE TABLE collection (
106 collectionid INTEGER PRIMARY KEY NOT NULL,
107 name varchar(100) NOT NULL
0009fa49 108);
109
ebf846e8 110
0009fa49 111--
ebf846e8 112-- Table: collection_object
0009fa49 113--
ebf846e8 114CREATE TABLE collection_object (
115 collection integer NOT NULL,
116 object integer NOT NULL,
117 PRIMARY KEY (collection, object)
0009fa49 118);
119
ebf846e8 120CREATE INDEX collection_object_idx_collection_collection_obj ON collection_object (collection);
121CREATE INDEX collection_object_idx_object_c ON collection_object (object);
122
0009fa49 123--
ebf846e8 124-- Table: employee
887ce227 125--
ebf846e8 126CREATE TABLE employee (
127 employee_id INTEGER PRIMARY KEY NOT NULL,
128 position integer NOT NULL,
129 group_id integer,
130 group_id_2 integer,
131 name varchar(100)
887ce227 132);
133
ebf846e8 134
9fcda149 135--
ebf846e8 136-- Table: event
ab8481f5 137--
ebf846e8 138CREATE TABLE event (
ab8481f5 139 id INTEGER PRIMARY KEY NOT NULL,
ebf846e8 140 starts_at datetime NOT NULL,
a97fe7e0 141 created_on timestamp NOT NULL,
142 varchar_date varchar(20),
ff8a6e3b 143 varchar_datetime varchar(20),
a0dd8679 144 skip_inflation datetime
ab8481f5 145);
146
ebf846e8 147
ab8481f5 148--
4740bdb7 149-- Table: file_columns
150--
151CREATE TABLE file_columns (
152 id INTEGER PRIMARY KEY NOT NULL,
ebf846e8 153 file varchar(255) NOT NULL
4740bdb7 154);
155
ebf846e8 156
4740bdb7 157--
ebf846e8 158-- Table: forceforeign
77211009 159--
ebf846e8 160CREATE TABLE forceforeign (
161 artist INTEGER PRIMARY KEY NOT NULL,
162 cd integer NOT NULL
77211009 163);
164
ebf846e8 165CREATE INDEX forceforeign_idx_artist_forcef ON forceforeign (artist);
166
77211009 167--
ebf846e8 168-- Table: fourkeys
9c2c91ea 169--
ebf846e8 170CREATE TABLE fourkeys (
171 foo integer NOT NULL,
172 bar integer NOT NULL,
173 hello integer NOT NULL,
174 goodbye integer NOT NULL,
175 sensors character NOT NULL,
176 PRIMARY KEY (foo, bar, hello, goodbye)
0009fa49 177);
178
ebf846e8 179
0009fa49 180--
ebf846e8 181-- Table: fourkeys_to_twokeys
0009fa49 182--
ebf846e8 183CREATE TABLE fourkeys_to_twokeys (
184 f_foo integer NOT NULL,
185 f_bar integer NOT NULL,
186 f_hello integer NOT NULL,
187 f_goodbye integer NOT NULL,
188 t_artist integer NOT NULL,
189 t_cd integer NOT NULL,
190 autopilot character NOT NULL,
191 PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd)
0009fa49 192);
193
ebf846e8 194CREATE 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);
195CREATE INDEX fourkeys_to_twokeys_idx_t_artist_t_cd_fourkeys_to ON fourkeys_to_twokeys (t_artist, t_cd);
196
887ce227 197--
ebf846e8 198-- Table: genre
887ce227 199--
ebf846e8 200CREATE TABLE genre (
87310237 201 genreid INTEGER PRIMARY KEY NOT NULL,
202 name varchar(100) NOT NULL
9c2c91ea 203);
204
87310237 205CREATE UNIQUE INDEX genre_name_genre ON genre (name);
ebf846e8 206
207--
4f6386b0 208-- Table: images
209--
210CREATE TABLE images (
211 id INTEGER PRIMARY KEY NOT NULL,
212 artwork_id integer NOT NULL,
213 name varchar(100) NOT NULL,
214 data blob
215);
216
217CREATE INDEX images_idx_artwork_id_images ON images (artwork_id);
218
219--
ebf846e8 220-- Table: liner_notes
221--
222CREATE TABLE liner_notes (
223 liner_id INTEGER PRIMARY KEY NOT NULL,
224 notes varchar(100) NOT NULL
225);
226
6bf6ba2f 227CREATE INDEX liner_notes_idx_liner_id_liner ON liner_notes (liner_id);
ebf846e8 228
229--
230-- Table: link
231--
232CREATE TABLE link (
233 id INTEGER PRIMARY KEY NOT NULL,
234 url varchar(100),
235 title varchar(100)
236);
237
238
9c2c91ea 239--
4f6386b0 240-- Table: lyric_versions
241--
242CREATE TABLE lyric_versions (
243 id INTEGER PRIMARY KEY NOT NULL,
244 lyric_id integer NOT NULL,
245 text varchar(100) NOT NULL
246);
247
248CREATE INDEX lyric_versions_idx_lyric_id_ly ON lyric_versions (lyric_id);
249
250--
251-- Table: lyrics
252--
253CREATE TABLE lyrics (
254 lyric_id INTEGER PRIMARY KEY NOT NULL,
255 track_id integer NOT NULL
256);
257
258CREATE INDEX lyrics_idx_track_id_lyrics ON lyrics (track_id);
259
260--
89034887 261-- Table: noprimarykey
262--
263CREATE TABLE noprimarykey (
264 foo integer NOT NULL,
265 bar integer NOT NULL,
266 baz integer NOT NULL
267);
268
ebf846e8 269CREATE UNIQUE INDEX foo_bar_noprimarykey ON noprimarykey (foo, bar);
270
89034887 271--
ebf846e8 272-- Table: onekey
9c2c91ea 273--
ebf846e8 274CREATE TABLE onekey (
275 id INTEGER PRIMARY KEY NOT NULL,
276 artist integer NOT NULL,
277 cd integer NOT NULL
9c2c91ea 278);
279
ebf846e8 280
9c2c91ea 281--
ebf846e8 282-- Table: owners
9c2c91ea 283--
ebf846e8 284CREATE TABLE owners (
285 ownerid INTEGER PRIMARY KEY NOT NULL,
286 name varchar(100) NOT NULL
9c2c91ea 287);
288
ebf846e8 289
9c2c91ea 290--
291-- Table: producer
292--
293CREATE TABLE producer (
294 producerid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 295 name varchar(100) NOT NULL
887ce227 296);
297
ebf846e8 298CREATE UNIQUE INDEX prod_name_producer ON producer (name);
299
9fcda149 300--
ebf846e8 301-- Table: self_ref
9fcda149 302--
ebf846e8 303CREATE TABLE self_ref (
8fcf21b3 304 id INTEGER PRIMARY KEY NOT NULL,
ebf846e8 305 name varchar(100) NOT NULL
9fcda149 306);
307
ebf846e8 308
78060df8 309--
ebf846e8 310-- Table: self_ref_alias
78060df8 311--
ebf846e8 312CREATE TABLE self_ref_alias (
313 self_ref integer NOT NULL,
314 alias integer NOT NULL,
315 PRIMARY KEY (self_ref, alias)
78060df8 316);
317
ebf846e8 318CREATE INDEX self_ref_alias_idx_alias_self_ ON self_ref_alias (alias);
319CREATE INDEX self_ref_alias_idx_self_ref_se ON self_ref_alias (self_ref);
320
78060df8 321--
ebf846e8 322-- Table: sequence_test
78060df8 323--
ebf846e8 324CREATE TABLE sequence_test (
325 pkid1 integer NOT NULL,
326 pkid2 integer NOT NULL,
327 nonpkid integer NOT NULL,
328 name varchar(100),
329 PRIMARY KEY (pkid1, pkid2)
78060df8 330);
331
ebf846e8 332
78060df8 333--
ebf846e8 334-- Table: serialized
78060df8 335--
ebf846e8 336CREATE TABLE serialized (
337 id INTEGER PRIMARY KEY NOT NULL,
338 serialized text NOT NULL
78060df8 339);
340
ebf846e8 341
78060df8 342--
ebf846e8 343-- Table: tags
78060df8 344--
ebf846e8 345CREATE TABLE tags (
346 tagid INTEGER PRIMARY KEY NOT NULL,
347 cd integer NOT NULL,
348 tag varchar(100) NOT NULL
78060df8 349);
350
ebf846e8 351CREATE INDEX tags_idx_cd_tags ON tags (cd);
352
78060df8 353--
ebf846e8 354-- Table: track
78060df8 355--
ebf846e8 356CREATE TABLE track (
357 trackid INTEGER PRIMARY KEY NOT NULL,
358 cd integer NOT NULL,
359 position integer NOT NULL,
360 title varchar(100) NOT NULL,
361 last_updated_on datetime
362);
363
364CREATE INDEX track_idx_cd_track ON track (cd);
365CREATE UNIQUE INDEX track_cd_position_track ON track (cd, position);
366CREATE UNIQUE INDEX track_cd_title_track ON track (cd, title);
367
368--
369-- Table: treelike
370--
371CREATE TABLE treelike (
78060df8 372 id INTEGER PRIMARY KEY NOT NULL,
ebf846e8 373 parent integer,
374 name varchar(100) NOT NULL
375);
376
377CREATE INDEX treelike_idx_parent_treelike ON treelike (parent);
378
379--
380-- Table: twokeytreelike
381--
382CREATE TABLE twokeytreelike (
383 id1 integer NOT NULL,
384 id2 integer NOT NULL,
385 parent1 integer NOT NULL,
386 parent2 integer NOT NULL,
387 name varchar(100) NOT NULL,
388 PRIMARY KEY (id1, id2)
389);
390
391CREATE INDEX twokeytreelike_idx_parent1_parent2_twokeytre ON twokeytreelike (parent1, parent2);
392CREATE UNIQUE INDEX tktlnameunique_twokeytreelike ON twokeytreelike (name);
393
394--
395-- Table: twokeys
396--
397CREATE TABLE twokeys (
398 artist integer NOT NULL,
399 cd integer NOT NULL,
400 PRIMARY KEY (artist, cd)
401);
402
403CREATE INDEX twokeys_idx_artist_twokeys ON twokeys (artist);
404
405--
406-- Table: typed_object
407--
408CREATE TABLE typed_object (
409 objectid INTEGER PRIMARY KEY NOT NULL,
410 type varchar(100) NOT NULL,
411 value varchar(100) NOT NULL
78060df8 412);
413
0e80c4ca 414--
415-- Table: encoded
416--
417CREATE TABLE encoded (
418 id INTEGER PRIMARY KEY NOT NULL,
419 encoded varchar(100) NOT NULL
420);
78060df8 421
0009fa49 422COMMIT;