Commit | Line | Data |
0009fa49 |
1 | -- |
2 | -- Created by SQL::Translator::Producer::SQLite |
38e48163 |
3 | -- Created on Wed Apr 19 18:32:39 2006 |
0009fa49 |
4 | -- |
5 | BEGIN TRANSACTION; |
6 | |
7 | -- |
38e48163 |
8 | -- Table: employee |
4e298a80 |
9 | -- |
38e48163 |
10 | CREATE 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 | -- |
20 | CREATE TABLE serialized ( |
21 | id INTEGER PRIMARY KEY NOT NULL, |
22 | serialized text NOT NULL |
23 | ); |
24 | |
25 | -- |
38e48163 |
26 | -- Table: liner_notes |
27 | -- |
28 | CREATE 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 |
36 | CREATE 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 | -- |
45 | CREATE TABLE artist ( |
46 | artistid INTEGER PRIMARY KEY NOT NULL, |
80021def |
47 | name varchar(100) |
48 | ); |
49 | |
50 | -- |
38e48163 |
51 | -- Table: twokeytreelike |
52 | -- |
53 | CREATE 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 | -- |
65 | CREATE 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 | -- |
74 | CREATE 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 | -- |
0009fa49 |
82 | -- Table: track |
83 | -- |
84 | CREATE TABLE track ( |
85 | trackid INTEGER PRIMARY KEY NOT NULL, |
86 | cd integer NOT NULL, |
87 | position integer NOT NULL, |
8fcf21b3 |
88 | title varchar(100) NOT NULL |
0009fa49 |
89 | ); |
90 | |
91 | -- |
0a298c73 |
92 | -- Table: self_ref |
1c339d71 |
93 | -- |
0a298c73 |
94 | CREATE TABLE self_ref ( |
80021def |
95 | id INTEGER PRIMARY KEY NOT NULL, |
8fcf21b3 |
96 | name varchar(100) NOT NULL |
0009fa49 |
97 | ); |
98 | |
99 | -- |
0a298c73 |
100 | -- Table: treelike |
887ce227 |
101 | -- |
0a298c73 |
102 | CREATE TABLE treelike ( |
887ce227 |
103 | id INTEGER PRIMARY KEY NOT NULL, |
0a298c73 |
104 | parent integer NOT NULL, |
8fcf21b3 |
105 | name varchar(100) NOT NULL |
887ce227 |
106 | ); |
107 | |
9fcda149 |
108 | -- |
4e298a80 |
109 | -- Table: tags |
9fcda149 |
110 | -- |
4e298a80 |
111 | CREATE TABLE tags ( |
112 | tagid INTEGER PRIMARY KEY NOT NULL, |
80021def |
113 | cd integer NOT NULL, |
4e298a80 |
114 | tag varchar(100) NOT NULL |
80021def |
115 | ); |
116 | |
117 | -- |
4e298a80 |
118 | -- Table: twokeys |
1e3ff014 |
119 | -- |
4e298a80 |
120 | CREATE TABLE twokeys ( |
121 | artist integer NOT NULL, |
122 | cd integer NOT NULL, |
123 | PRIMARY KEY (artist, cd) |
1e3ff014 |
124 | ); |
125 | |
126 | -- |
80021def |
127 | -- Table: fourkeys |
128 | -- |
129 | CREATE TABLE fourkeys ( |
130 | foo integer NOT NULL, |
131 | bar integer NOT NULL, |
132 | hello integer NOT NULL, |
133 | goodbye integer NOT NULL, |
134 | PRIMARY KEY (foo, bar, hello, goodbye) |
135 | ); |
136 | |
137 | -- |
138 | -- Table: artist_undirected_map |
139 | -- |
140 | CREATE TABLE artist_undirected_map ( |
141 | id1 integer NOT NULL, |
142 | id2 integer NOT NULL, |
143 | PRIMARY KEY (id1, id2) |
144 | ); |
145 | |
146 | -- |
147 | -- Table: onekey |
148 | -- |
149 | CREATE TABLE onekey ( |
8fcf21b3 |
150 | id INTEGER PRIMARY KEY NOT NULL, |
80021def |
151 | artist integer NOT NULL, |
152 | cd integer NOT NULL |
153 | ); |
154 | |
38e48163 |
155 | -- |
156 | -- Table: producer |
157 | -- |
158 | CREATE TABLE producer ( |
159 | producerid INTEGER PRIMARY KEY NOT NULL, |
160 | name varchar(100) NOT NULL |
161 | ); |
162 | |
163 | CREATE UNIQUE INDEX position_group_employee on employee (position, group_id); |
164 | CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name); |
165 | CREATE UNIQUE INDEX artist_title_cd on cd (artist, title); |
0009fa49 |
166 | COMMIT; |