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