added more many_to_many tests and changed add_to_rel to accept linking table column...
[dbsrgits/DBIx-Class.git] / t / lib / sqlite.sql
CommitLineData
0009fa49 1--
2-- Created by SQL::Translator::Producer::SQLite
3bd6e3e0 3-- Created on Sat Jun 17 07:46:56 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--
0a298c73 18-- Table: serialized
19--
20CREATE TABLE serialized (
21 id INTEGER PRIMARY KEY NOT NULL,
22 serialized text NOT NULL
23);
24
25--
4e298a80 26-- Table: cd_to_producer
0009fa49 27--
4e298a80 28CREATE TABLE cd_to_producer (
29 cd integer NOT NULL,
30 producer integer NOT NULL,
31 PRIMARY KEY (cd, producer)
0009fa49 32);
33
34--
3bd6e3e0 35-- Table: liner_notes
36--
37CREATE TABLE liner_notes (
38 liner_id INTEGER PRIMARY KEY NOT NULL,
39 notes varchar(100) NOT NULL
40);
41
42--
0009fa49 43-- Table: artist
44--
45CREATE TABLE artist (
46 artistid INTEGER PRIMARY KEY NOT NULL,
80021def 47 name varchar(100)
48);
49
50--
3bd6e3e0 51-- Table: fourkeys_to_twokeys
52--
53CREATE TABLE fourkeys_to_twokeys (
54 f_foo integer NOT NULL,
55 f_bar integer NOT NULL,
56 f_hello integer NOT NULL,
57 f_goodbye integer NOT NULL,
58 t_artist integer NOT NULL,
59 t_cd integer NOT NULL,
60 autopilot character NOT NULL,
61 PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd)
62);
63
64--
38e48163 65-- Table: twokeytreelike
66--
67CREATE TABLE twokeytreelike (
68 id1 integer NOT NULL,
69 id2 integer NOT NULL,
70 parent1 integer NOT NULL,
71 parent2 integer NOT NULL,
72 name varchar(100) NOT NULL,
73 PRIMARY KEY (id1, id2)
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--
8e6df6ae 96-- Table: bookmark
97--
98CREATE TABLE bookmark (
99 id INTEGER PRIMARY KEY NOT NULL,
100 link integer NOT NULL
101);
102
103--
0009fa49 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: treelike
1c339d71 115--
3bd6e3e0 116CREATE TABLE treelike (
80021def 117 id INTEGER PRIMARY KEY NOT NULL,
3bd6e3e0 118 parent integer NOT NULL,
8fcf21b3 119 name 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--
8e6df6ae 131-- Table: link
9fcda149 132--
8e6df6ae 133CREATE TABLE link (
134 id INTEGER PRIMARY KEY NOT NULL,
135 url varchar(100),
136 title varchar(100)
80021def 137);
138
139--
3bd6e3e0 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--
f86fcf0d 149-- Table: event
150--
151CREATE TABLE event (
152 id INTEGER PRIMARY KEY NOT NULL,
153 starts_at datetime NOT NULL
154);
155
156--
4e298a80 157-- Table: twokeys
1e3ff014 158--
4e298a80 159CREATE TABLE twokeys (
160 artist integer NOT NULL,
161 cd integer NOT NULL,
162 PRIMARY KEY (artist, cd)
1e3ff014 163);
164
165--
80021def 166-- Table: fourkeys
167--
168CREATE TABLE fourkeys (
169 foo integer NOT NULL,
170 bar integer NOT NULL,
171 hello integer NOT NULL,
172 goodbye integer NOT NULL,
3bd6e3e0 173 sensors character NOT NULL,
80021def 174 PRIMARY KEY (foo, bar, hello, goodbye)
175);
176
177--
178-- Table: artist_undirected_map
179--
180CREATE TABLE artist_undirected_map (
181 id1 integer NOT NULL,
182 id2 integer NOT NULL,
183 PRIMARY KEY (id1, id2)
184);
185
186--
3bd6e3e0 187-- Table: producer
188--
189CREATE TABLE producer (
190 producerid INTEGER PRIMARY KEY NOT NULL,
191 name varchar(100) NOT NULL
192);
193
194--
80021def 195-- Table: onekey
196--
197CREATE TABLE onekey (
8fcf21b3 198 id INTEGER PRIMARY KEY NOT NULL,
80021def 199 artist integer NOT NULL,
200 cd integer NOT NULL
201);
202
38e48163 203CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name);
368a5228 204CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title);
205CREATE UNIQUE INDEX prod_name_producer on producer (name);
0009fa49 206COMMIT;