Add automatic naming of unique constraints
[dbsrgits/DBIx-Class.git] / t / lib / sqlite.sql
CommitLineData
0009fa49 1--
2-- Created by SQL::Translator::Producer::SQLite
368a5228 3-- Created on Sat May 27 21:28:05 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--
38e48163 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--
4e298a80 34-- Table: cd_to_producer
0009fa49 35--
4e298a80 36CREATE TABLE cd_to_producer (
37 cd integer NOT NULL,
38 producer integer NOT NULL,
39 PRIMARY KEY (cd, producer)
0009fa49 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--
38e48163 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--
0009fa49 63-- Table: self_ref_alias
64--
65CREATE TABLE self_ref_alias (
66 self_ref integer NOT NULL,
887ce227 67 alias integer NOT NULL,
68 PRIMARY KEY (self_ref, alias)
0009fa49 69);
70
71--
0009fa49 72-- Table: cd
73--
74CREATE TABLE cd (
75 cdid INTEGER PRIMARY KEY NOT NULL,
76 artist integer NOT NULL,
8fcf21b3 77 title varchar(100) NOT NULL,
78 year varchar(100) NOT NULL
0009fa49 79);
80
81--
8e6df6ae 82-- Table: bookmark
83--
84CREATE TABLE bookmark (
85 id INTEGER PRIMARY KEY NOT NULL,
86 link integer NOT NULL
87);
88
89--
0009fa49 90-- Table: track
91--
92CREATE TABLE track (
93 trackid INTEGER PRIMARY KEY NOT NULL,
94 cd integer NOT NULL,
95 position integer NOT NULL,
8fcf21b3 96 title varchar(100) NOT NULL
0009fa49 97);
98
99--
0a298c73 100-- Table: self_ref
1c339d71 101--
0a298c73 102CREATE TABLE self_ref (
80021def 103 id INTEGER PRIMARY KEY NOT NULL,
8fcf21b3 104 name varchar(100) NOT NULL
0009fa49 105);
106
107--
4e298a80 108-- Table: tags
9fcda149 109--
4e298a80 110CREATE TABLE tags (
111 tagid INTEGER PRIMARY KEY NOT NULL,
80021def 112 cd integer NOT NULL,
4e298a80 113 tag varchar(100) NOT NULL
80021def 114);
115
116--
0a298c73 117-- Table: treelike
887ce227 118--
0a298c73 119CREATE TABLE treelike (
887ce227 120 id INTEGER PRIMARY KEY NOT NULL,
0a298c73 121 parent integer NOT NULL,
8fcf21b3 122 name varchar(100) NOT NULL
887ce227 123);
124
9fcda149 125--
8e6df6ae 126-- Table: link
9fcda149 127--
8e6df6ae 128CREATE TABLE link (
129 id INTEGER PRIMARY KEY NOT NULL,
130 url varchar(100),
131 title varchar(100)
80021def 132);
133
134--
f86fcf0d 135-- Table: event
136--
137CREATE TABLE event (
138 id INTEGER PRIMARY KEY NOT NULL,
139 starts_at datetime NOT NULL
140);
141
142--
4e298a80 143-- Table: twokeys
1e3ff014 144--
4e298a80 145CREATE TABLE twokeys (
146 artist integer NOT NULL,
147 cd integer NOT NULL,
148 PRIMARY KEY (artist, cd)
1e3ff014 149);
150
151--
80021def 152-- Table: fourkeys
153--
154CREATE TABLE fourkeys (
155 foo integer NOT NULL,
156 bar integer NOT NULL,
157 hello integer NOT NULL,
158 goodbye integer NOT NULL,
159 PRIMARY KEY (foo, bar, hello, goodbye)
160);
161
162--
163-- Table: artist_undirected_map
164--
165CREATE TABLE artist_undirected_map (
166 id1 integer NOT NULL,
167 id2 integer NOT NULL,
168 PRIMARY KEY (id1, id2)
169);
170
171--
172-- Table: onekey
173--
174CREATE TABLE onekey (
8fcf21b3 175 id INTEGER PRIMARY KEY NOT NULL,
80021def 176 artist integer NOT NULL,
177 cd integer NOT NULL
178);
179
38e48163 180--
181-- Table: producer
182--
183CREATE TABLE producer (
184 producerid INTEGER PRIMARY KEY NOT NULL,
185 name varchar(100) NOT NULL
186);
187
38e48163 188CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name);
368a5228 189CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title);
190CREATE UNIQUE INDEX prod_name_producer on producer (name);
0009fa49 191COMMIT;