X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fsqlite.sql;h=9d4921041b2f86717c2eb4985cd75164ea1d265e;hb=86bb5a27da;hp=a74d91a576a0c685b09ad6b8a10e84618d6a7d5a;hpb=09451687c711f8b8db7186fb60b07aa165de8046;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index a74d91a..9d49210 100644 --- a/t/lib/sqlite.sql +++ b/t/lib/sqlite.sql @@ -1,21 +1,24 @@ -- -- Created by SQL::Translator::Producer::SQLite --- Created on Thu Jul 30 09:36:16 2009 +-- Created on Fri Mar 2 18:22:33 2012 -- - -BEGIN TRANSACTION; - -- -- Table: artist -- CREATE TABLE artist ( artistid INTEGER PRIMARY KEY NOT NULL, name varchar(100), - rank integer NOT NULL DEFAULT '13', + rank integer NOT NULL DEFAULT 13, charfield char(10) ); +CREATE INDEX artist_name_hookidx ON artist (name); + +CREATE UNIQUE INDEX artist_name ON artist (name); + +CREATE UNIQUE INDEX u_nullable ON artist (charfield, rank); + -- -- Table: bindtype_test -- @@ -23,7 +26,8 @@ CREATE TABLE bindtype_test ( id INTEGER PRIMARY KEY NOT NULL, bytea blob, blob blob, - clob clob + clob clob, + a_memo memo ); -- @@ -35,18 +39,6 @@ CREATE TABLE collection ( ); -- --- Table: employee --- -CREATE TABLE employee ( - employee_id INTEGER PRIMARY KEY NOT NULL, - position integer NOT NULL, - group_id integer, - group_id_2 integer, - group_id_3 integer, - name varchar(100) -); - --- -- Table: encoded -- CREATE TABLE encoded ( @@ -59,7 +51,7 @@ CREATE TABLE encoded ( -- CREATE TABLE event ( id INTEGER PRIMARY KEY NOT NULL, - starts_at datetime NOT NULL, + starts_at date NOT NULL, created_on timestamp NOT NULL, varchar_date varchar(20), varchar_datetime varchar(20), @@ -68,14 +60,6 @@ CREATE TABLE event ( ); -- --- Table: file_columns --- -CREATE TABLE file_columns ( - id INTEGER PRIMARY KEY NOT NULL, - file varchar(255) NOT NULL -); - --- -- Table: fourkeys -- CREATE TABLE fourkeys ( @@ -84,7 +68,7 @@ CREATE TABLE fourkeys ( hello integer NOT NULL, goodbye integer NOT NULL, sensors character(10) NOT NULL, - read_count integer, + read_count int, PRIMARY KEY (foo, bar, hello, goodbye) ); @@ -143,6 +127,8 @@ CREATE TABLE owners ( name varchar(100) NOT NULL ); +CREATE UNIQUE INDEX owners_name ON owners (name); + -- -- Table: producer -- @@ -181,6 +167,14 @@ CREATE TABLE serialized ( ); -- +-- Table: timestamp_primary_key_test +-- +CREATE TABLE timestamp_primary_key_test ( + id timestamp NOT NULL DEFAULT current_timestamp, + PRIMARY KEY (id) +); + +-- -- Table: treelike -- CREATE TABLE treelike ( @@ -252,6 +246,23 @@ CREATE TABLE books ( CREATE INDEX books_idx_owner ON books (owner); +CREATE UNIQUE INDEX books_title ON books (title); + +-- +-- Table: employee +-- +CREATE TABLE employee ( + employee_id INTEGER PRIMARY KEY NOT NULL, + position integer NOT NULL, + group_id integer, + group_id_2 integer, + group_id_3 integer, + name varchar(100), + encoded integer +); + +CREATE INDEX employee_idx_encoded ON employee (encoded); + -- -- Table: forceforeign -- @@ -260,8 +271,6 @@ CREATE TABLE forceforeign ( cd integer NOT NULL ); -CREATE INDEX forceforeign_idx_artist ON forceforeign (artist); - -- -- Table: self_ref_alias -- @@ -281,11 +290,10 @@ CREATE INDEX self_ref_alias_idx_self_ref ON self_ref_alias (self_ref); CREATE TABLE track ( trackid INTEGER PRIMARY KEY NOT NULL, cd integer NOT NULL, - position integer NOT NULL, + position int NOT NULL, title varchar(100) NOT NULL, last_updated_on datetime, - last_updated_at datetime, - small_dt smalldatetime + last_updated_at datetime ); CREATE INDEX track_idx_cd ON track (cd); @@ -344,8 +352,6 @@ CREATE TABLE cd_artwork ( cd_id INTEGER PRIMARY KEY NOT NULL ); -CREATE INDEX cd_artwork_idx_cd_id ON cd_artwork (cd_id); - -- -- Table: liner_notes -- @@ -354,8 +360,6 @@ CREATE TABLE liner_notes ( notes varchar(100) NOT NULL ); -CREATE INDEX liner_notes_idx_liner_id ON liner_notes (liner_id); - -- -- Table: lyric_versions -- @@ -378,6 +382,14 @@ CREATE TABLE tags ( CREATE INDEX tags_idx_cd ON tags (cd); +CREATE UNIQUE INDEX tagid_cd ON tags (tagid, cd); + +CREATE UNIQUE INDEX tagid_cd_tag ON tags (tagid, cd, tag); + +CREATE UNIQUE INDEX tags_tagid_tag ON tags (tagid, tag); + +CREATE UNIQUE INDEX tags_tagid_tag_cd ON tags (tagid, tag, cd); + -- -- Table: cd_to_producer -- @@ -451,6 +463,4 @@ CREATE INDEX fourkeys_to_twokeys_idx_t_artist_t_cd ON fourkeys_to_twokeys (t_art -- View: year2000cds -- CREATE VIEW year2000cds AS - SELECT cdid, artist, title FROM cd WHERE year ='2000'; - -COMMIT; + SELECT cdid, artist, title, year, genreid, single_track FROM cd WHERE year = "2000";