Switch out one more reliance on connect_info
[dbsrgits/DBIx-Class.git] / t / lib / sqlite.sql
CommitLineData
0009fa49 1--
2-- Created by SQL::Translator::Producer::SQLite
a0dd8679 3-- Created on Sun Nov 9 16:28:17 2008
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--
ebf846e8 32-- Table: bookmark
3bd6e3e0 33--
ebf846e8 34CREATE TABLE bookmark (
35 id INTEGER PRIMARY KEY NOT NULL,
36 link integer NOT NULL
3bd6e3e0 37);
38
ebf846e8 39CREATE INDEX bookmark_idx_link_bookmark ON bookmark (link);
40
3bd6e3e0 41--
ebf846e8 42-- Table: books
0009fa49 43--
ebf846e8 44CREATE 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--
56CREATE 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 64CREATE INDEX cd_idx_artist_cd ON cd (artist);
65CREATE INDEX cd_idx_genreid_cd ON cd (genreid);
66CREATE UNIQUE INDEX cd_artist_title_cd ON cd (artist, title);
67
370f2ba2 68--
ebf846e8 69-- Table: cd_to_producer
370f2ba2 70--
ebf846e8 71CREATE TABLE cd_to_producer (
72 cd integer NOT NULL,
73 producer integer NOT NULL,
74 PRIMARY KEY (cd, producer)
0009fa49 75);
76
ebf846e8 77CREATE INDEX cd_to_producer_idx_cd_cd_to_pr ON cd_to_producer (cd);
78CREATE INDEX cd_to_producer_idx_producer_cd ON cd_to_producer (producer);
79
0009fa49 80--
ebf846e8 81-- Table: collection
0009fa49 82--
ebf846e8 83CREATE 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 92CREATE TABLE collection_object (
93 collection integer NOT NULL,
94 object integer NOT NULL,
95 PRIMARY KEY (collection, object)
0009fa49 96);
97
ebf846e8 98CREATE INDEX collection_object_idx_collection_collection_obj ON collection_object (collection);
99CREATE INDEX collection_object_idx_object_c ON collection_object (object);
100
0009fa49 101--
ebf846e8 102-- Table: employee
887ce227 103--
ebf846e8 104CREATE 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 116CREATE 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--
129CREATE 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 138CREATE TABLE forceforeign (
139 artist INTEGER PRIMARY KEY NOT NULL,
140 cd integer NOT NULL
77211009 141);
142
ebf846e8 143CREATE INDEX forceforeign_idx_artist_forcef ON forceforeign (artist);
144
77211009 145--
ebf846e8 146-- Table: fourkeys
9c2c91ea 147--
ebf846e8 148CREATE 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 161CREATE 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 172CREATE 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);
173CREATE 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 178CREATE TABLE genre (
87310237 179 genreid INTEGER PRIMARY KEY NOT NULL,
180 name varchar(100) NOT NULL
9c2c91ea 181);
182
87310237 183CREATE UNIQUE INDEX genre_name_genre ON genre (name);
ebf846e8 184
185--
186-- Table: liner_notes
187--
188CREATE TABLE liner_notes (
189 liner_id INTEGER PRIMARY KEY NOT NULL,
190 notes varchar(100) NOT NULL
191);
192
193
194--
195-- Table: link
196--
197CREATE TABLE link (
198 id INTEGER PRIMARY KEY NOT NULL,
199 url varchar(100),
200 title varchar(100)
201);
202
203
9c2c91ea 204--
89034887 205-- Table: noprimarykey
206--
207CREATE TABLE noprimarykey (
208 foo integer NOT NULL,
209 bar integer NOT NULL,
210 baz integer NOT NULL
211);
212
ebf846e8 213CREATE UNIQUE INDEX foo_bar_noprimarykey ON noprimarykey (foo, bar);
214
89034887 215--
ebf846e8 216-- Table: onekey
9c2c91ea 217--
ebf846e8 218CREATE TABLE onekey (
219 id INTEGER PRIMARY KEY NOT NULL,
220 artist integer NOT NULL,
221 cd integer NOT NULL
9c2c91ea 222);
223
ebf846e8 224
9c2c91ea 225--
ebf846e8 226-- Table: owners
9c2c91ea 227--
ebf846e8 228CREATE TABLE owners (
229 ownerid INTEGER PRIMARY KEY NOT NULL,
230 name varchar(100) NOT NULL
9c2c91ea 231);
232
ebf846e8 233
9c2c91ea 234--
235-- Table: producer
236--
237CREATE TABLE producer (
238 producerid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 239 name varchar(100) NOT NULL
887ce227 240);
241
ebf846e8 242CREATE UNIQUE INDEX prod_name_producer ON producer (name);
243
9fcda149 244--
ebf846e8 245-- Table: self_ref
9fcda149 246--
ebf846e8 247CREATE TABLE self_ref (
8fcf21b3 248 id INTEGER PRIMARY KEY NOT NULL,
ebf846e8 249 name varchar(100) NOT NULL
9fcda149 250);
251
ebf846e8 252
78060df8 253--
ebf846e8 254-- Table: self_ref_alias
78060df8 255--
ebf846e8 256CREATE TABLE self_ref_alias (
257 self_ref integer NOT NULL,
258 alias integer NOT NULL,
259 PRIMARY KEY (self_ref, alias)
78060df8 260);
261
ebf846e8 262CREATE INDEX self_ref_alias_idx_alias_self_ ON self_ref_alias (alias);
263CREATE INDEX self_ref_alias_idx_self_ref_se ON self_ref_alias (self_ref);
264
78060df8 265--
ebf846e8 266-- Table: sequence_test
78060df8 267--
ebf846e8 268CREATE TABLE sequence_test (
269 pkid1 integer NOT NULL,
270 pkid2 integer NOT NULL,
271 nonpkid integer NOT NULL,
272 name varchar(100),
273 PRIMARY KEY (pkid1, pkid2)
78060df8 274);
275
ebf846e8 276
78060df8 277--
ebf846e8 278-- Table: serialized
78060df8 279--
ebf846e8 280CREATE TABLE serialized (
281 id INTEGER PRIMARY KEY NOT NULL,
282 serialized text NOT NULL
78060df8 283);
284
ebf846e8 285
78060df8 286--
ebf846e8 287-- Table: tags
78060df8 288--
ebf846e8 289CREATE TABLE tags (
290 tagid INTEGER PRIMARY KEY NOT NULL,
291 cd integer NOT NULL,
292 tag varchar(100) NOT NULL
78060df8 293);
294
ebf846e8 295CREATE INDEX tags_idx_cd_tags ON tags (cd);
296
78060df8 297--
ebf846e8 298-- Table: track
78060df8 299--
ebf846e8 300CREATE TABLE track (
301 trackid INTEGER PRIMARY KEY NOT NULL,
302 cd integer NOT NULL,
303 position integer NOT NULL,
304 title varchar(100) NOT NULL,
305 last_updated_on datetime
306);
307
308CREATE INDEX track_idx_cd_track ON track (cd);
309CREATE UNIQUE INDEX track_cd_position_track ON track (cd, position);
310CREATE UNIQUE INDEX track_cd_title_track ON track (cd, title);
311
312--
313-- Table: treelike
314--
315CREATE TABLE treelike (
78060df8 316 id INTEGER PRIMARY KEY NOT NULL,
ebf846e8 317 parent integer,
318 name varchar(100) NOT NULL
319);
320
321CREATE INDEX treelike_idx_parent_treelike ON treelike (parent);
322
323--
324-- Table: twokeytreelike
325--
326CREATE TABLE twokeytreelike (
327 id1 integer NOT NULL,
328 id2 integer NOT NULL,
329 parent1 integer NOT NULL,
330 parent2 integer NOT NULL,
331 name varchar(100) NOT NULL,
332 PRIMARY KEY (id1, id2)
333);
334
335CREATE INDEX twokeytreelike_idx_parent1_parent2_twokeytre ON twokeytreelike (parent1, parent2);
336CREATE UNIQUE INDEX tktlnameunique_twokeytreelike ON twokeytreelike (name);
337
338--
339-- Table: twokeys
340--
341CREATE TABLE twokeys (
342 artist integer NOT NULL,
343 cd integer NOT NULL,
344 PRIMARY KEY (artist, cd)
345);
346
347CREATE INDEX twokeys_idx_artist_twokeys ON twokeys (artist);
348
349--
350-- Table: typed_object
351--
352CREATE TABLE typed_object (
353 objectid INTEGER PRIMARY KEY NOT NULL,
354 type varchar(100) NOT NULL,
355 value varchar(100) NOT NULL
78060df8 356);
357
358
0009fa49 359COMMIT;