Merge 'trunk' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class.git] / t / lib / sqlite.sql
CommitLineData
0009fa49 1--
2-- Created by SQL::Translator::Producer::SQLite
77211009 3-- Created on Tue Aug 8 01:53:20 2006
0009fa49 4--
5BEGIN TRANSACTION;
6
7--
38e48163 8-- Table: employee
4e298a80 9--
38e48163 10CREATE 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--
21CREATE TABLE serialized (
22 id INTEGER PRIMARY KEY NOT NULL,
23 serialized text NOT NULL
24);
25
26--
8fcf21b3 27-- Table: liner_notes
28--
29CREATE 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--
37CREATE 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--
46CREATE TABLE artist (
47 artistid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 48 name varchar(100)
0009fa49 49);
50
51--
9c2c91ea 52-- Table: twokeytreelike
53--
54CREATE 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--
66CREATE 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--
80CREATE 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--
89CREATE 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 99CREATE TABLE bookmark (
0009fa49 100 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 101 link integer NOT NULL
0009fa49 102);
103
104--
105-- Table: track
106--
107CREATE TABLE track (
108 trackid INTEGER PRIMARY KEY NOT NULL,
109 cd integer NOT NULL,
110 position integer NOT NULL,
8fcf21b3 111 title varchar(100) NOT NULL
0009fa49 112);
113
114--
3bd6e3e0 115-- Table: self_ref
887ce227 116--
3bd6e3e0 117CREATE TABLE self_ref (
887ce227 118 id INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 119 name varchar(100) NOT NULL
887ce227 120);
121
9fcda149 122--
ab8481f5 123-- Table: link
124--
125CREATE TABLE link (
126 id INTEGER PRIMARY KEY NOT NULL,
127 url varchar(100),
128 title varchar(100)
129);
130
131--
4740bdb7 132-- Table: file_columns
133--
134CREATE TABLE file_columns (
135 id INTEGER PRIMARY KEY NOT NULL,
136 file varchar(255)
137);
138
139--
77211009 140-- Table: tags
141--
142CREATE TABLE tags (
143 tagid INTEGER PRIMARY KEY NOT NULL,
144 cd integer NOT NULL,
145 tag varchar(100) NOT NULL
146);
147
148--
9c2c91ea 149-- Table: treelike
150--
151CREATE TABLE treelike (
152 id INTEGER PRIMARY KEY NOT NULL,
153 parent integer NOT NULL,
8fcf21b3 154 name varchar(100) NOT NULL
0009fa49 155);
156
157--
f86fcf0d 158-- Table: event
0009fa49 159--
f86fcf0d 160CREATE TABLE event (
161 id INTEGER PRIMARY KEY NOT NULL,
c03ccdbc 162 starts_at datetime NOT NULL,
163 created_on timestamp NOT NULL
0009fa49 164);
165
887ce227 166--
9c2c91ea 167-- Table: twokeys
887ce227 168--
9c2c91ea 169CREATE TABLE twokeys (
170 artist integer NOT NULL,
171 cd integer NOT NULL,
172 PRIMARY KEY (artist, cd)
173);
174
175--
89034887 176-- Table: noprimarykey
177--
178CREATE TABLE noprimarykey (
179 foo integer NOT NULL,
180 bar integer NOT NULL,
181 baz integer NOT NULL
182);
183
184--
9c2c91ea 185-- Table: fourkeys
186--
187CREATE TABLE fourkeys (
188 foo integer NOT NULL,
189 bar integer NOT NULL,
190 hello integer NOT NULL,
191 goodbye integer NOT NULL,
3bd6e3e0 192 sensors character NOT NULL,
9c2c91ea 193 PRIMARY KEY (foo, bar, hello, goodbye)
194);
195
196--
197-- Table: artist_undirected_map
198--
199CREATE TABLE artist_undirected_map (
200 id1 integer NOT NULL,
201 id2 integer NOT NULL,
202 PRIMARY KEY (id1, id2)
203);
204
205--
206-- Table: producer
207--
208CREATE TABLE producer (
209 producerid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 210 name varchar(100) NOT NULL
887ce227 211);
212
9fcda149 213--
9c2c91ea 214-- Table: onekey
9fcda149 215--
9c2c91ea 216CREATE TABLE onekey (
8fcf21b3 217 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 218 artist integer NOT NULL,
219 cd integer NOT NULL
9fcda149 220);
221
78060df8 222--
223-- Table: typed_object
224--
225CREATE TABLE typed_object (
226 objectid INTEGER PRIMARY KEY NOT NULL,
227 type VARCHAR(100) NOT NULL,
228 value VARCHAR(100)
229);
230
231--
232-- Table: collection
233--
234CREATE TABLE collection (
235 collectionid INTEGER PRIMARY KEY NOT NULL,
236 name VARCHAR(100)
237);
238
239--
240-- Table: collection_object
241--
242CREATE TABLE collection_object (
243 collection INTEGER NOT NULL,
244 object INTEGER NOT NULL
245);
246
247--
248-- Table: owners
249--
250CREATE TABLE owners (
251 ownerid INTEGER PRIMARY KEY NOT NULL,
252 name varchar(100)
253);
254
255--
256-- Table: books
257--
258CREATE TABLE books (
259 id INTEGER PRIMARY KEY NOT NULL,
260 owner INTEGER,
261 source varchar(100),
262 title varchar(100)
263);
264
265
38e48163 266CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name);
368a5228 267CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title);
365d06b7 268CREATE UNIQUE INDEX track_cd_position_track on track (cd, position);
269CREATE UNIQUE INDEX track_cd_title_track on track (cd, title);
89034887 270CREATE UNIQUE INDEX foo_bar_noprimarykey on noprimarykey (foo, bar);
368a5228 271CREATE UNIQUE INDEX prod_name_producer on producer (name);
0009fa49 272COMMIT;