backport the DBIx::Class::Storage::DBI::DESTROY fix for peopel sharing $dbh to other...
[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,
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,
8fcf21b3 47 name varchar(100)
0009fa49 48);
49
50--
9c2c91ea 51-- Table: twokeytreelike
52--
53CREATE TABLE twokeytreelike (
54 id1 integer NOT NULL,
55 id2 integer NOT NULL,
56 parent1 integer NOT NULL,
57 parent2 integer NOT NULL,
58 name varchar(100) NOT NULL,
59 PRIMARY KEY (id1, id2)
60);
61
62--
3bd6e3e0 63-- Table: fourkeys_to_twokeys
64--
65CREATE TABLE fourkeys_to_twokeys (
66 f_foo integer NOT NULL,
67 f_bar integer NOT NULL,
68 f_hello integer NOT NULL,
69 f_goodbye integer NOT NULL,
70 t_artist integer NOT NULL,
71 t_cd integer NOT NULL,
72 autopilot character NOT NULL,
73 PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd)
74);
75
76--
0009fa49 77-- Table: self_ref_alias
78--
79CREATE TABLE self_ref_alias (
80 self_ref integer NOT NULL,
887ce227 81 alias integer NOT NULL,
82 PRIMARY KEY (self_ref, alias)
0009fa49 83);
84
85--
0009fa49 86-- Table: cd
87--
88CREATE TABLE cd (
89 cdid INTEGER PRIMARY KEY NOT NULL,
90 artist integer NOT NULL,
8fcf21b3 91 title varchar(100) NOT NULL,
92 year varchar(100) NOT NULL
0009fa49 93);
94
95--
9c2c91ea 96-- Table: bookmark
0009fa49 97--
9c2c91ea 98CREATE TABLE bookmark (
0009fa49 99 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 100 link integer NOT NULL
0009fa49 101);
102
103--
104-- Table: track
105--
106CREATE TABLE track (
107 trackid INTEGER PRIMARY KEY NOT NULL,
108 cd integer NOT NULL,
109 position integer NOT NULL,
8fcf21b3 110 title varchar(100) NOT NULL
0009fa49 111);
112
113--
3bd6e3e0 114-- Table: self_ref
887ce227 115--
3bd6e3e0 116CREATE TABLE self_ref (
887ce227 117 id INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 118 name varchar(100) NOT NULL
887ce227 119);
120
9fcda149 121--
ab8481f5 122-- Table: link
123--
124CREATE TABLE link (
125 id INTEGER PRIMARY KEY NOT NULL,
126 url varchar(100),
127 title varchar(100)
128);
129
130--
77211009 131-- Table: tags
132--
133CREATE TABLE tags (
134 tagid INTEGER PRIMARY KEY NOT NULL,
135 cd integer NOT NULL,
136 tag varchar(100) NOT NULL
137);
138
139--
9c2c91ea 140-- Table: treelike
141--
142CREATE TABLE treelike (
143 id INTEGER PRIMARY KEY NOT NULL,
144 parent integer NOT NULL,
8fcf21b3 145 name varchar(100) NOT NULL
0009fa49 146);
147
148--
f86fcf0d 149-- Table: event
0009fa49 150--
f86fcf0d 151CREATE TABLE event (
152 id INTEGER PRIMARY KEY NOT NULL,
c03ccdbc 153 starts_at datetime NOT NULL,
154 created_on timestamp NOT NULL
0009fa49 155);
156
887ce227 157--
9c2c91ea 158-- Table: twokeys
887ce227 159--
9c2c91ea 160CREATE TABLE twokeys (
161 artist integer NOT NULL,
162 cd integer NOT NULL,
163 PRIMARY KEY (artist, cd)
164);
165
166--
89034887 167-- Table: noprimarykey
168--
169CREATE TABLE noprimarykey (
170 foo integer NOT NULL,
171 bar integer NOT NULL,
172 baz integer NOT NULL
173);
174
175--
9c2c91ea 176-- Table: fourkeys
177--
178CREATE TABLE fourkeys (
179 foo integer NOT NULL,
180 bar integer NOT NULL,
181 hello integer NOT NULL,
182 goodbye integer NOT NULL,
3bd6e3e0 183 sensors character NOT NULL,
9c2c91ea 184 PRIMARY KEY (foo, bar, hello, goodbye)
185);
186
187--
188-- Table: artist_undirected_map
189--
190CREATE TABLE artist_undirected_map (
191 id1 integer NOT NULL,
192 id2 integer NOT NULL,
193 PRIMARY KEY (id1, id2)
194);
195
196--
197-- Table: producer
198--
199CREATE TABLE producer (
200 producerid INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 201 name varchar(100) NOT NULL
887ce227 202);
203
9fcda149 204--
9c2c91ea 205-- Table: onekey
9fcda149 206--
9c2c91ea 207CREATE TABLE onekey (
8fcf21b3 208 id INTEGER PRIMARY KEY NOT NULL,
9c2c91ea 209 artist integer NOT NULL,
210 cd integer NOT NULL
9fcda149 211);
212
38e48163 213CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name);
368a5228 214CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title);
365d06b7 215CREATE UNIQUE INDEX track_cd_position_track on track (cd, position);
216CREATE UNIQUE INDEX track_cd_title_track on track (cd, title);
89034887 217CREATE UNIQUE INDEX foo_bar_noprimarykey on noprimarykey (foo, bar);
368a5228 218CREATE UNIQUE INDEX prod_name_producer on producer (name);
0009fa49 219COMMIT;