Fix two aliasing bugs: remove the alias when provided to new_result and add the alias...
[dbsrgits/DBIx-Class.git] / t / lib / sqlite.sql
CommitLineData
0009fa49 1--
2-- Created by SQL::Translator::Producer::SQLite
ab8481f5 3-- Created on Fri Aug 4 19:03:21 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,
14 name varchar(100)
15);
16
17--
8fcf21b3 18-- Table: serialized
19--
20CREATE TABLE serialized (
21 id INTEGER PRIMARY KEY NOT NULL,
22 serialized text NOT NULL
23);
24
25--
8fcf21b3 26-- Table: liner_notes
27--
28CREATE TABLE liner_notes (
29 liner_id INTEGER PRIMARY KEY NOT NULL,
30 notes varchar(100) NOT NULL
31);
32
33--
0009fa49 34-- Table: cd_to_producer
35--
36CREATE TABLE cd_to_producer (
37 cd integer NOT NULL,
38 producer integer NOT NULL,
39 PRIMARY KEY (cd, producer)
40);
41
42--
43-- Table: artist
44--
45CREATE TABLE artist (
46 artistid INTEGER PRIMARY KEY NOT NULL,
ab8481f5 47 agent integer,
48 name varchar(100)
49);
50
51--
52-- Table: label
53--
54CREATE TABLE label (
55 labelid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 56 name varchar(100)
0009fa49 57);
58
59--
9c2c91ea 60-- Table: twokeytreelike
61--
62CREATE TABLE twokeytreelike (
63 id1 integer NOT NULL,
64 id2 integer NOT NULL,
65 parent1 integer NOT NULL,
66 parent2 integer NOT NULL,
67 name varchar(100) NOT NULL,
68 PRIMARY KEY (id1, id2)
69);
70
71--
3bd6e3e0 72-- Table: fourkeys_to_twokeys
73--
74CREATE TABLE fourkeys_to_twokeys (
75 f_foo integer NOT NULL,
76 f_bar integer NOT NULL,
77 f_hello integer NOT NULL,
78 f_goodbye integer NOT NULL,
79 t_artist integer NOT NULL,
80 t_cd integer NOT NULL,
81 autopilot character NOT NULL,
82 PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd)
83);
84
85--
0009fa49 86-- Table: self_ref_alias
87--
88CREATE TABLE self_ref_alias (
89 self_ref integer NOT NULL,
887ce227 90 alias integer NOT NULL,
91 PRIMARY KEY (self_ref, alias)
0009fa49 92);
93
94--
0009fa49 95-- Table: cd
96--
97CREATE TABLE cd (
98 cdid INTEGER PRIMARY KEY NOT NULL,
99 artist integer NOT NULL,
8fcf21b3 100 title varchar(100) NOT NULL,
101 year varchar(100) NOT NULL
0009fa49 102);
103
104--
9c2c91ea 105-- Table: bookmark
0009fa49 106--
9c2c91ea 107CREATE TABLE bookmark (
0009fa49 108 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 109 link integer NOT NULL
0009fa49 110);
111
112--
113-- Table: track
114--
115CREATE TABLE track (
116 trackid INTEGER PRIMARY KEY NOT NULL,
117 cd integer NOT NULL,
118 position integer NOT NULL,
8fcf21b3 119 title varchar(100) NOT NULL
0009fa49 120);
121
122--
3bd6e3e0 123-- Table: self_ref
887ce227 124--
3bd6e3e0 125CREATE TABLE self_ref (
887ce227 126 id INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 127 name varchar(100) NOT NULL
887ce227 128);
129
9fcda149 130--
3bd6e3e0 131-- Table: tags
9c2c91ea 132--
3bd6e3e0 133CREATE TABLE tags (
134 tagid INTEGER PRIMARY KEY NOT NULL,
135 cd integer NOT NULL,
136 tag varchar(100) NOT NULL
9c2c91ea 137);
138
139--
ab8481f5 140-- Table: agent
141--
142CREATE TABLE agent (
143 agentid INTEGER PRIMARY KEY NOT NULL,
144 label integer NOT NULL,
145 name varchar(100)
146);
147
148--
149-- Table: link
150--
151CREATE TABLE link (
152 id INTEGER PRIMARY KEY NOT NULL,
153 url varchar(100),
154 title varchar(100)
155);
156
157--
9c2c91ea 158-- Table: treelike
159--
160CREATE TABLE treelike (
161 id INTEGER PRIMARY KEY NOT NULL,
162 parent integer NOT NULL,
8fcf21b3 163 name varchar(100) NOT NULL
0009fa49 164);
165
166--
f86fcf0d 167-- Table: event
0009fa49 168--
f86fcf0d 169CREATE TABLE event (
170 id INTEGER PRIMARY KEY NOT NULL,
c03ccdbc 171 starts_at datetime NOT NULL,
172 created_on timestamp NOT NULL
0009fa49 173);
174
887ce227 175--
9c2c91ea 176-- Table: twokeys
887ce227 177--
9c2c91ea 178CREATE TABLE twokeys (
179 artist integer NOT NULL,
180 cd integer NOT NULL,
181 PRIMARY KEY (artist, cd)
182);
183
184--
89034887 185-- Table: noprimarykey
186--
187CREATE TABLE noprimarykey (
188 foo integer NOT NULL,
189 bar integer NOT NULL,
190 baz integer NOT NULL
191);
192
193--
9c2c91ea 194-- Table: fourkeys
195--
196CREATE TABLE fourkeys (
197 foo integer NOT NULL,
198 bar integer NOT NULL,
199 hello integer NOT NULL,
200 goodbye integer NOT NULL,
3bd6e3e0 201 sensors character NOT NULL,
9c2c91ea 202 PRIMARY KEY (foo, bar, hello, goodbye)
203);
204
205--
206-- Table: artist_undirected_map
207--
208CREATE TABLE artist_undirected_map (
209 id1 integer NOT NULL,
210 id2 integer NOT NULL,
211 PRIMARY KEY (id1, id2)
212);
213
214--
215-- Table: producer
216--
217CREATE TABLE producer (
218 producerid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 219 name varchar(100) NOT NULL
887ce227 220);
221
9fcda149 222--
9c2c91ea 223-- Table: onekey
9fcda149 224--
9c2c91ea 225CREATE TABLE onekey (
8fcf21b3 226 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 227 artist integer NOT NULL,
228 cd integer NOT NULL
9fcda149 229);
230
38e48163 231CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name);
368a5228 232CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title);
365d06b7 233CREATE UNIQUE INDEX track_cd_position_track on track (cd, position);
234CREATE UNIQUE INDEX track_cd_title_track on track (cd, title);
89034887 235CREATE UNIQUE INDEX foo_bar_noprimarykey on noprimarykey (foo, bar);
368a5228 236CREATE UNIQUE INDEX prod_name_producer on producer (name);
0009fa49 237COMMIT;