fix related resultsets and multi-create
[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,
370f2ba2 93 year varchar(100) NOT NULL,
94 genreid integer
95);
96
97--
98-- Table: genre
99--
100CREATE TABLE genre (
101 genreid INTEGER PRIMARY KEY NOT NULL,
102 name varchar(100) NOT NULL
0009fa49 103);
104
105--
9c2c91ea 106-- Table: bookmark
0009fa49 107--
9c2c91ea 108CREATE TABLE bookmark (
0009fa49 109 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 110 link integer NOT NULL
0009fa49 111);
112
113--
114-- Table: track
115--
116CREATE TABLE track (
117 trackid INTEGER PRIMARY KEY NOT NULL,
118 cd integer NOT NULL,
119 position integer NOT NULL,
43556c5d 120 title varchar(100) NOT NULL,
121 last_updated_on datetime NULL
0009fa49 122);
123
124--
3bd6e3e0 125-- Table: self_ref
887ce227 126--
3bd6e3e0 127CREATE TABLE self_ref (
887ce227 128 id INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 129 name varchar(100) NOT NULL
887ce227 130);
131
9fcda149 132--
ab8481f5 133-- Table: link
134--
135CREATE TABLE link (
136 id INTEGER PRIMARY KEY NOT NULL,
137 url varchar(100),
138 title varchar(100)
139);
140
141--
4740bdb7 142-- Table: file_columns
143--
144CREATE TABLE file_columns (
145 id INTEGER PRIMARY KEY NOT NULL,
146 file varchar(255)
147);
148
149--
77211009 150-- Table: tags
151--
152CREATE TABLE tags (
153 tagid INTEGER PRIMARY KEY NOT NULL,
154 cd integer NOT NULL,
155 tag varchar(100) NOT NULL
156);
157
158--
9c2c91ea 159-- Table: treelike
160--
161CREATE TABLE treelike (
162 id INTEGER PRIMARY KEY NOT NULL,
61177e44 163 parent integer NULL,
8fcf21b3 164 name varchar(100) NOT NULL
0009fa49 165);
166
167--
f86fcf0d 168-- Table: event
0009fa49 169--
f86fcf0d 170CREATE TABLE event (
171 id INTEGER PRIMARY KEY NOT NULL,
c03ccdbc 172 starts_at datetime NOT NULL,
173 created_on timestamp NOT NULL
0009fa49 174);
175
887ce227 176--
9c2c91ea 177-- Table: twokeys
887ce227 178--
9c2c91ea 179CREATE TABLE twokeys (
180 artist integer NOT NULL,
181 cd integer NOT NULL,
182 PRIMARY KEY (artist, cd)
183);
184
185--
89034887 186-- Table: noprimarykey
187--
188CREATE TABLE noprimarykey (
189 foo integer NOT NULL,
190 bar integer NOT NULL,
191 baz integer NOT NULL
192);
193
194--
9c2c91ea 195-- Table: fourkeys
196--
197CREATE TABLE fourkeys (
198 foo integer NOT NULL,
199 bar integer NOT NULL,
200 hello integer NOT NULL,
201 goodbye integer NOT NULL,
3bd6e3e0 202 sensors character NOT NULL,
9c2c91ea 203 PRIMARY KEY (foo, bar, hello, goodbye)
204);
205
206--
207-- Table: artist_undirected_map
208--
209CREATE TABLE artist_undirected_map (
210 id1 integer NOT NULL,
211 id2 integer NOT NULL,
212 PRIMARY KEY (id1, id2)
213);
214
215--
216-- Table: producer
217--
218CREATE TABLE producer (
219 producerid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 220 name varchar(100) NOT NULL
887ce227 221);
222
9fcda149 223--
9c2c91ea 224-- Table: onekey
9fcda149 225--
9c2c91ea 226CREATE TABLE onekey (
8fcf21b3 227 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 228 artist integer NOT NULL,
229 cd integer NOT NULL
9fcda149 230);
231
78060df8 232--
233-- Table: typed_object
234--
235CREATE TABLE typed_object (
236 objectid INTEGER PRIMARY KEY NOT NULL,
237 type VARCHAR(100) NOT NULL,
238 value VARCHAR(100)
239);
240
241--
242-- Table: collection
243--
244CREATE TABLE collection (
245 collectionid INTEGER PRIMARY KEY NOT NULL,
246 name VARCHAR(100)
247);
248
249--
250-- Table: collection_object
251--
252CREATE TABLE collection_object (
253 collection INTEGER NOT NULL,
254 object INTEGER NOT NULL
255);
256
257--
258-- Table: owners
259--
260CREATE TABLE owners (
261 ownerid INTEGER PRIMARY KEY NOT NULL,
262 name varchar(100)
263);
264
265--
266-- Table: books
267--
268CREATE TABLE books (
269 id INTEGER PRIMARY KEY NOT NULL,
270 owner INTEGER,
271 source varchar(100),
272 title varchar(100)
273);
274
275
38e48163 276CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name);
368a5228 277CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title);
365d06b7 278CREATE UNIQUE INDEX track_cd_position_track on track (cd, position);
279CREATE UNIQUE INDEX track_cd_title_track on track (cd, title);
89034887 280CREATE UNIQUE INDEX foo_bar_noprimarykey on noprimarykey (foo, bar);
368a5228 281CREATE UNIQUE INDEX prod_name_producer on producer (name);
0009fa49 282COMMIT;