X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fsqlite.sql;h=441c811cfa16107252fe2ee1d79f2003c03a9cc1;hb=1c7ae8d1d2f52bb86704e0caf3128a8097442635;hp=263b234eefca068fe3a6f270e0b63c92be0d9a2a;hpb=6ec7d1bb91a155777ad469cc219bf7442015f825;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index 263b234..441c811 100644 --- a/t/lib/sqlite.sql +++ b/t/lib/sqlite.sql @@ -1,10 +1,11 @@ -- -- Created by SQL::Translator::Producer::SQLite --- Created on Sat Jan 17 19:40:47 2009 +-- Created on Thu May 28 10:10:00 2009 -- -BEGIN TRANSACTION; +BEGIN TRANSACTION; + -- -- Table: artist -- @@ -15,7 +16,6 @@ CREATE TABLE artist ( charfield char(10) ); - -- -- Table: artist_undirected_map -- @@ -26,6 +26,7 @@ CREATE TABLE artist_undirected_map ( ); CREATE INDEX artist_undirected_map_idx_id1_ ON artist_undirected_map (id1); + CREATE INDEX artist_undirected_map_idx_id2_ ON artist_undirected_map (id2); -- @@ -38,6 +39,19 @@ CREATE TABLE cd_artwork ( CREATE INDEX cd_artwork_idx_cd_id_cd_artwor ON cd_artwork (cd_id); -- +-- Table: artwork_to_artist +-- +CREATE TABLE artwork_to_artist ( + artwork_cd_id integer NOT NULL, + artist_id integer NOT NULL, + PRIMARY KEY (artwork_cd_id, artist_id) +); + +CREATE INDEX artwork_to_artist_idx_artist_id_artwork_to_arti ON artwork_to_artist (artist_id); + +CREATE INDEX artwork_to_artist_idx_artwork_cd_id_artwork_to_ ON artwork_to_artist (artwork_cd_id); + +-- -- Table: bindtype_test -- CREATE TABLE bindtype_test ( @@ -47,7 +61,6 @@ CREATE TABLE bindtype_test ( clob clob ); - -- -- Table: bookmark -- @@ -69,6 +82,7 @@ CREATE TABLE books ( price integer ); +CREATE INDEX books_idx_owner_books ON books (owner); -- -- Table: cd @@ -83,8 +97,11 @@ CREATE TABLE cd ( ); CREATE INDEX cd_idx_artist_cd ON cd (artist); + CREATE INDEX cd_idx_genreid_cd ON cd (genreid); + CREATE INDEX cd_idx_single_track_cd ON cd (single_track); + CREATE UNIQUE INDEX cd_artist_title_cd ON cd (artist, title); -- @@ -93,10 +110,12 @@ CREATE UNIQUE INDEX cd_artist_title_cd ON cd (artist, title); CREATE TABLE cd_to_producer ( cd integer NOT NULL, producer integer NOT NULL, + attribute integer, PRIMARY KEY (cd, producer) ); CREATE INDEX cd_to_producer_idx_cd_cd_to_pr ON cd_to_producer (cd); + CREATE INDEX cd_to_producer_idx_producer_cd ON cd_to_producer (producer); -- @@ -107,7 +126,6 @@ CREATE TABLE collection ( name varchar(100) NOT NULL ); - -- -- Table: collection_object -- @@ -118,6 +136,7 @@ CREATE TABLE collection_object ( ); CREATE INDEX collection_object_idx_collection_collection_obj ON collection_object (collection); + CREATE INDEX collection_object_idx_object_c ON collection_object (object); -- @@ -128,9 +147,17 @@ CREATE TABLE employee ( position integer NOT NULL, group_id integer, group_id_2 integer, + group_id_3 integer, name varchar(100) ); +-- +-- Table: encoded +-- +CREATE TABLE encoded ( + id INTEGER PRIMARY KEY NOT NULL, + encoded varchar(100) +); -- -- Table: event @@ -144,7 +171,6 @@ CREATE TABLE event ( skip_inflation datetime ); - -- -- Table: file_columns -- @@ -153,7 +179,6 @@ CREATE TABLE file_columns ( file varchar(255) NOT NULL ); - -- -- Table: forceforeign -- @@ -172,11 +197,11 @@ CREATE TABLE fourkeys ( bar integer NOT NULL, hello integer NOT NULL, goodbye integer NOT NULL, - sensors character NOT NULL, + sensors character(10) NOT NULL, + read_count integer, PRIMARY KEY (foo, bar, hello, goodbye) ); - -- -- Table: fourkeys_to_twokeys -- @@ -188,10 +213,12 @@ CREATE TABLE fourkeys_to_twokeys ( t_artist integer NOT NULL, t_cd integer NOT NULL, autopilot character NOT NULL, + pilot_sequence integer, PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd) ); CREATE INDEX fourkeys_to_twokeys_idx_f_foo_f_bar_f_hello_f_goodbye_ ON fourkeys_to_twokeys (f_foo, f_bar, f_hello, f_goodbye); + CREATE INDEX fourkeys_to_twokeys_idx_t_artist_t_cd_fourkeys_to ON fourkeys_to_twokeys (t_artist, t_cd); -- @@ -235,7 +262,6 @@ CREATE TABLE link ( title varchar(100) ); - -- -- Table: lyric_versions -- @@ -277,16 +303,14 @@ CREATE TABLE onekey ( cd integer NOT NULL ); - -- -- Table: owners -- CREATE TABLE owners ( - ownerid INTEGER PRIMARY KEY NOT NULL, + id INTEGER PRIMARY KEY NOT NULL, name varchar(100) NOT NULL ); - -- -- Table: producer -- @@ -305,7 +329,6 @@ CREATE TABLE self_ref ( name varchar(100) NOT NULL ); - -- -- Table: self_ref_alias -- @@ -316,6 +339,7 @@ CREATE TABLE self_ref_alias ( ); CREATE INDEX self_ref_alias_idx_alias_self_ ON self_ref_alias (alias); + CREATE INDEX self_ref_alias_idx_self_ref_se ON self_ref_alias (self_ref); -- @@ -329,7 +353,6 @@ CREATE TABLE sequence_test ( PRIMARY KEY (pkid1, pkid2) ); - -- -- Table: serialized -- @@ -338,7 +361,6 @@ CREATE TABLE serialized ( serialized text NOT NULL ); - -- -- Table: tags -- @@ -358,11 +380,14 @@ CREATE TABLE track ( cd integer NOT NULL, position integer NOT NULL, title varchar(100) NOT NULL, - last_updated_on datetime + last_updated_on datetime, + last_updated_at datetime ); CREATE INDEX track_idx_cd_track ON track (cd); + CREATE UNIQUE INDEX track_cd_position_track ON track (cd, position); + CREATE UNIQUE INDEX track_cd_title_track ON track (cd, title); -- @@ -389,6 +414,7 @@ CREATE TABLE twokeytreelike ( ); CREATE INDEX twokeytreelike_idx_parent1_parent2_twokeytre ON twokeytreelike (parent1, parent2); + CREATE UNIQUE INDEX tktlnameunique_twokeytreelike ON twokeytreelike (name); -- @@ -411,5 +437,10 @@ CREATE TABLE typed_object ( value varchar(100) NOT NULL ); +-- +-- View: year2000cds +-- +CREATE VIEW year2000cds AS + SELECT cdid, artist, title FROM cd WHERE year ='2000'; COMMIT;