1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
|
--
-- Created by SQL::Translator::Producer::SQLite
-- Created on Tue Aug 8 01:53:20 2006
--
BEGIN TRANSACTION;
--
-- Table: employee
--
CREATE TABLE employee (
employee_id INTEGER PRIMARY KEY NOT NULL,
position integer NOT NULL,
group_id integer,
group_id_2 integer,
name varchar(100)
);
--
-- Table: serialized
--
CREATE TABLE serialized (
id INTEGER PRIMARY KEY NOT NULL,
serialized text NOT NULL
);
--
-- Table: liner_notes
--
CREATE TABLE liner_notes (
liner_id INTEGER PRIMARY KEY NOT NULL,
notes varchar(100) NOT NULL
);
--
-- Table: cd_to_producer
--
CREATE TABLE cd_to_producer (
cd integer NOT NULL,
producer integer NOT NULL,
PRIMARY KEY (cd, producer)
);
--
-- Table: artist
--
CREATE TABLE artist (
artistid INTEGER PRIMARY KEY NOT NULL,
name varchar(100)
);
--
-- Table: twokeytreelike
--
CREATE TABLE twokeytreelike (
id1 integer NOT NULL,
id2 integer NOT NULL,
parent1 integer NOT NULL,
parent2 integer NOT NULL,
name varchar(100) NOT NULL,
PRIMARY KEY (id1, id2)
);
--
-- Table: fourkeys_to_twokeys
--
CREATE TABLE fourkeys_to_twokeys (
f_foo integer NOT NULL,
f_bar integer NOT NULL,
f_hello integer NOT NULL,
f_goodbye integer NOT NULL,
t_artist integer NOT NULL,
t_cd integer NOT NULL,
autopilot character NOT NULL,
PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd)
);
--
-- Table: self_ref_alias
--
CREATE TABLE self_ref_alias (
self_ref integer NOT NULL,
alias integer NOT NULL,
PRIMARY KEY (self_ref, alias)
);
--
-- Table: cd
--
CREATE TABLE cd (
cdid INTEGER PRIMARY KEY NOT NULL,
artist integer NOT NULL,
title varchar(100) NOT NULL,
year varchar(100) NOT NULL
);
--
-- Table: bookmark
--
CREATE TABLE bookmark (
id INTEGER PRIMARY KEY NOT NULL,
link integer NOT NULL
);
--
-- Table: track
--
CREATE TABLE track (
trackid INTEGER PRIMARY KEY NOT NULL,
cd integer NOT NULL,
position integer NOT NULL,
title varchar(100) NOT NULL,
last_updated_on datetime NULL
);
--
-- Table: self_ref
--
CREATE TABLE self_ref (
id INTEGER PRIMARY KEY NOT NULL,
name varchar(100) NOT NULL
);
--
-- Table: link
--
CREATE TABLE link (
id INTEGER PRIMARY KEY NOT NULL,
url varchar(100),
title varchar(100)
);
--
-- Table: file_columns
--
CREATE TABLE file_columns (
id INTEGER PRIMARY KEY NOT NULL,
file varchar(255)
);
--
-- Table: tags
--
CREATE TABLE tags (
tagid INTEGER PRIMARY KEY NOT NULL,
cd integer NOT NULL,
tag varchar(100) NOT NULL
);
--
-- Table: treelike
--
CREATE TABLE treelike (
id INTEGER PRIMARY KEY NOT NULL,
parent integer NOT NULL,
name varchar(100) NOT NULL
);
--
-- Table: event
--
CREATE TABLE event (
id INTEGER PRIMARY KEY NOT NULL,
starts_at datetime NOT NULL,
created_on timestamp NOT NULL
);
--
-- Table: twokeys
--
CREATE TABLE twokeys (
artist integer NOT NULL,
cd integer NOT NULL,
PRIMARY KEY (artist, cd)
);
--
-- Table: noprimarykey
--
CREATE TABLE noprimarykey (
foo integer NOT NULL,
bar integer NOT NULL,
baz integer NOT NULL
);
--
-- Table: fourkeys
--
CREATE TABLE fourkeys (
foo integer NOT NULL,
bar integer NOT NULL,
hello integer NOT NULL,
goodbye integer NOT NULL,
sensors character NOT NULL,
PRIMARY KEY (foo, bar, hello, goodbye)
);
--
-- Table: artist_undirected_map
--
CREATE TABLE artist_undirected_map (
id1 integer NOT NULL,
id2 integer NOT NULL,
PRIMARY KEY (id1, id2)
);
--
-- Table: producer
--
CREATE TABLE producer (
producerid INTEGER PRIMARY KEY NOT NULL,
name varchar(100) NOT NULL
);
--
-- Table: onekey
--
CREATE TABLE onekey (
id INTEGER PRIMARY KEY NOT NULL,
artist integer NOT NULL,
cd integer NOT NULL
);
--
-- Table: typed_object
--
CREATE TABLE typed_object (
objectid INTEGER PRIMARY KEY NOT NULL,
type VARCHAR(100) NOT NULL,
value VARCHAR(100)
);
--
-- Table: collection
--
CREATE TABLE collection (
collectionid INTEGER PRIMARY KEY NOT NULL,
name VARCHAR(100)
);
--
-- Table: collection_object
--
CREATE TABLE collection_object (
collection INTEGER NOT NULL,
object INTEGER NOT NULL
);
--
-- Table: owners
--
CREATE TABLE owners (
ownerid INTEGER PRIMARY KEY NOT NULL,
name varchar(100)
);
--
-- Table: books
--
CREATE TABLE books (
id INTEGER PRIMARY KEY NOT NULL,
owner INTEGER,
source varchar(100),
title varchar(100)
);
CREATE UNIQUE INDEX tktlnameunique_twokeytreelike on twokeytreelike (name);
CREATE UNIQUE INDEX cd_artist_title_cd on cd (artist, title);
CREATE UNIQUE INDEX track_cd_position_track on track (cd, position);
CREATE UNIQUE INDEX track_cd_title_track on track (cd, title);
CREATE UNIQUE INDEX foo_bar_noprimarykey on noprimarykey (foo, bar);
CREATE UNIQUE INDEX prod_name_producer on producer (name);
COMMIT;
|