From: Jess Robinson Date: Wed, 18 Feb 2009 22:59:29 +0000 (+0000) Subject: Fix name of view. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=084a2c0ae84b2ae56f05deeb67dd007246f7692e;p=dbsrgits%2FDBIx-Class-Historic.git Fix name of view. New sqlite.sql containing test view. --- diff --git a/t/lib/DBICTest/Schema/Year2000CDs.pm b/t/lib/DBICTest/Schema/Year2000CDs.pm index 2a2c85b..be91397 100644 --- a/t/lib/DBICTest/Schema/Year2000CDs.pm +++ b/t/lib/DBICTest/Schema/Year2000CDs.pm @@ -6,7 +6,7 @@ use DBIx::Class::ResultSource::View; __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); -__PACKAGE__->table('cd'); +__PACKAGE__->table('year2000cds'); __PACKAGE__->result_source_instance->view_definition( "SELECT cdid, artist, title FROM cd WHERE year ='2000'" ); diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index ebc10cd..c827fcf 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 Wed Feb 18 22:31:31 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); -- @@ -47,7 +48,6 @@ CREATE TABLE bindtype_test ( clob clob ); - -- -- Table: bookmark -- @@ -69,7 +69,6 @@ CREATE TABLE books ( price integer ); - -- -- Table: cd -- @@ -83,8 +82,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); -- @@ -97,6 +99,7 @@ CREATE TABLE cd_to_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 +110,6 @@ CREATE TABLE collection ( name varchar(100) NOT NULL ); - -- -- Table: collection_object -- @@ -118,6 +120,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); -- @@ -131,6 +134,13 @@ CREATE TABLE employee ( name varchar(100) ); +-- +-- Table: encoded +-- +CREATE TABLE encoded ( + id INTEGER PRIMARY KEY NOT NULL, + encoded varchar(100) +); -- -- Table: event @@ -144,7 +154,6 @@ CREATE TABLE event ( skip_inflation datetime ); - -- -- Table: file_columns -- @@ -153,7 +162,6 @@ CREATE TABLE file_columns ( file varchar(255) NOT NULL ); - -- -- Table: forceforeign -- @@ -176,7 +184,6 @@ CREATE TABLE fourkeys ( PRIMARY KEY (foo, bar, hello, goodbye) ); - -- -- Table: fourkeys_to_twokeys -- @@ -192,6 +199,7 @@ CREATE TABLE fourkeys_to_twokeys ( ); 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 +243,6 @@ CREATE TABLE link ( title varchar(100) ); - -- -- Table: lyric_versions -- @@ -277,7 +284,6 @@ CREATE TABLE onekey ( cd integer NOT NULL ); - -- -- Table: owners -- @@ -286,7 +292,6 @@ CREATE TABLE owners ( name varchar(100) NOT NULL ); - -- -- Table: producer -- @@ -305,7 +310,6 @@ CREATE TABLE self_ref ( name varchar(100) NOT NULL ); - -- -- Table: self_ref_alias -- @@ -316,6 +320,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 +334,6 @@ CREATE TABLE sequence_test ( PRIMARY KEY (pkid1, pkid2) ); - -- -- Table: serialized -- @@ -338,7 +342,6 @@ CREATE TABLE serialized ( serialized text NOT NULL ); - -- -- Table: tags -- @@ -362,7 +365,9 @@ CREATE TABLE track ( ); 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 +394,7 @@ CREATE TABLE twokeytreelike ( ); CREATE INDEX twokeytreelike_idx_parent1_parent2_twokeytre ON twokeytreelike (parent1, parent2); + CREATE UNIQUE INDEX tktlnameunique_twokeytreelike ON twokeytreelike (name); -- @@ -412,11 +418,9 @@ CREATE TABLE typed_object ( ); -- --- Table: encoded +-- View: year2000cds -- -CREATE TABLE encoded ( - id INTEGER PRIMARY KEY NOT NULL, - encoded varchar(100) NOT NULL -); +CREATE VIEW year2000cds AS + SELECT cdid, artist, title FROM cd WHERE year ='2000'; COMMIT;