Merge 'views' into 'trunk'
Matt S Trout [Fri, 20 Feb 2009 07:56:49 +0000 (07:56 +0000)]
1  2 
t/lib/DBICTest/Schema.pm
t/lib/sqlite.sql

diff --combined t/lib/DBICTest/Schema.pm
@@@ -18,11 -18,12 +18,13 @@@ __PACKAGE__->load_classes(qw
    #dummy
    Track
    Tag
+   Year2000CDs
+   Year1999CDs
    /,
    { 'DBICTest::Schema' => [qw/
      LinerNotes
      Artwork
 +    Artwork_to_Artist
      Image
      Lyrics
      LyricVersion
diff --combined t/lib/sqlite.sql
@@@ -1,10 -1,11 +1,11 @@@
  -- 
  -- Created by SQL::Translator::Producer::SQLite
- -- Created on Sat Jan 24 19:42:15 2009
+ -- Created on Thu Feb 19 22:09:32 2009
  -- 
- BEGIN TRANSACTION;
  
  
+ BEGIN TRANSACTION;
  --
  -- Table: artist
  --
@@@ -15,7 -16,6 +16,6 @@@ CREATE TABLE artist 
    charfield char(10)
  );
  
  --
  -- Table: artist_undirected_map
  --
@@@ -26,6 -26,7 +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,18 -39,6 +39,18 @@@ 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 (
@@@ -59,7 -48,6 +60,6 @@@
    clob clob
  );
  
  --
  -- Table: bookmark
  --
@@@ -81,7 -69,6 +81,6 @@@ CREATE TABLE books 
    price integer
  );
  
  --
  -- Table: cd
  --
@@@ -95,8 -82,11 +94,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);
  
  --
@@@ -109,6 -99,7 +111,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);
  
  --
@@@ -119,7 -110,6 +122,6 @@@ CREATE TABLE collection 
    name varchar(100) NOT NULL
  );
  
  --
  -- Table: collection_object
  --
@@@ -130,6 -120,7 +132,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);
  
  --
@@@ -143,6 -134,13 +146,13 @@@ CREATE TABLE employee 
    name varchar(100)
  );
  
+ --
+ -- Table: encoded
+ --
+ CREATE TABLE encoded (
+   id INTEGER PRIMARY KEY NOT NULL,
+   encoded varchar(100)
+ );
  
  --
  -- Table: event
@@@ -156,7 -154,6 +166,6 @@@ CREATE TABLE event 
    skip_inflation datetime
  );
  
  --
  -- Table: file_columns
  --
@@@ -165,7 -162,6 +174,6 @@@ CREATE TABLE file_columns 
    file varchar(255) NOT NULL
  );
  
  --
  -- Table: forceforeign
  --
@@@ -188,7 -184,6 +196,6 @@@ CREATE TABLE fourkeys 
    PRIMARY KEY (foo, bar, hello, goodbye)
  );
  
  --
  -- Table: fourkeys_to_twokeys
  --
@@@ -204,6 -199,7 +211,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);
  
  --
@@@ -247,7 -243,6 +255,6 @@@ CREATE TABLE link 
    title varchar(100)
  );
  
  --
  -- Table: lyric_versions
  --
@@@ -289,7 -284,6 +296,6 @@@ CREATE TABLE onekey 
    cd integer NOT NULL
  );
  
  --
  -- Table: owners
  --
@@@ -298,7 -292,6 +304,6 @@@ CREATE TABLE owners 
    name varchar(100) NOT NULL
  );
  
  --
  -- Table: producer
  --
@@@ -317,7 -310,6 +322,6 @@@ CREATE TABLE self_ref 
    name varchar(100) NOT NULL
  );
  
  --
  -- Table: self_ref_alias
  --
@@@ -328,6 -320,7 +332,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);
  
  --
@@@ -341,7 -334,6 +346,6 @@@ CREATE TABLE sequence_test 
    PRIMARY KEY (pkid1, pkid2)
  );
  
  --
  -- Table: serialized
  --
@@@ -350,7 -342,6 +354,6 @@@ CREATE TABLE serialized 
    serialized text NOT NULL
  );
  
  --
  -- Table: tags
  --
@@@ -374,7 -365,9 +377,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);
  
  --
@@@ -401,6 -394,7 +406,7 @@@ CREATE TABLE twokeytreelike 
  );
  
  CREATE INDEX twokeytreelike_idx_parent1_parent2_twokeytre ON twokeytreelike (parent1, parent2);
  CREATE UNIQUE INDEX tktlnameunique_twokeytreelike ON twokeytreelike (name);
  
  --
@@@ -424,11 -418,9 +430,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;