[Bast-commits] r6035 - in DBIx-Class/0.08/trunk/t: . lib lib/DBICTest lib/DBICTest/Schema

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Thu Apr 30 08:12:24 GMT 2009


Author: ribasushi
Date: 2009-04-30 09:12:23 +0100 (Thu, 30 Apr 2009)
New Revision: 6035

Removed:
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Demographic.pm
Modified:
   DBIx-Class/0.08/trunk/t/66relationship.t
   DBIx-Class/0.08/trunk/t/93single_accessor_object.t
   DBIx-Class/0.08/trunk/t/96multi_create_torture.t
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Genre.pm
   DBIx-Class/0.08/trunk/t/lib/sqlite.sql
Log:
Revert addition of superficial relationship in r5886

Modified: DBIx-Class/0.08/trunk/t/66relationship.t
===================================================================
--- DBIx-Class/0.08/trunk/t/66relationship.t	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/66relationship.t	2009-04-30 08:12:23 UTC (rev 6035)
@@ -290,12 +290,13 @@
 my $relinfo_with_attr = $rs_overridden->relationship_info ('cd_3');
 cmp_ok($relinfo_with_attr->{attrs}{is_foreign_key_constraint}, '==', 0, "is_foreign_key_constraint defined for belongs_to relationships with attr.");
 
-# check that relationships below left join relationships are forced to left joins
-my $cds = $schema->resultset("CD")->search({ cdid => 1 }, { join => { genre => 'demographic' } });
+# check that relationships below left join relationships are forced to left joins 
+# when traversing multiple belongs_to
+my $cds = $schema->resultset("CD")->search({ 'me.cdid' => 5 }, { join => { single_track => 'cd' } });
 is($cds->count, 1, "subjoins under left joins force_left (string)");
 
-$cds = $schema->resultset("CD")->search({ cdid => 1 }, { join => { genre => [ 'demographic' ] } });
+$cds = $schema->resultset("CD")->search({ 'me.cdid' => 5 }, { join => { single_track => ['cd'] } });
 is($cds->count, 1, "subjoins under left joins force_left (arrayref)");
 
-$cds = $schema->resultset("CD")->search({ cdid => 1 }, { join => { genre => { demographic => {} } } });
+$cds = $schema->resultset("CD")->search({ 'me.cdid' => 5 }, { join => { single_track => { cd => {} } } });
 is($cds->count, 1, "subjoins under left joins force_left (hashref)");

Modified: DBIx-Class/0.08/trunk/t/93single_accessor_object.t
===================================================================
--- DBIx-Class/0.08/trunk/t/93single_accessor_object.t	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/93single_accessor_object.t	2009-04-30 08:12:23 UTC (rev 6035)
@@ -56,7 +56,7 @@
 
 {
 	my $artist = $schema->resultset('Artist')->create({ artistid => 666, name => 'bad religion' });
-	my $genre = $schema->resultset('Genre')->create({ genreid => 88, name => 'disco', demographicid => 1 });
+	my $genre = $schema->resultset('Genre')->create({ genreid => 88, name => 'disco' });
 	my $cd = $schema->resultset('CD')->create({ cdid => 187, artist => 1, title => 'how could hell be any worse?', year => 1982 });
 
 	dies_ok { $cd->genre } 'genre accessor throws without column';

Modified: DBIx-Class/0.08/trunk/t/96multi_create_torture.t
===================================================================
--- DBIx-Class/0.08/trunk/t/96multi_create_torture.t	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/96multi_create_torture.t	2009-04-30 08:12:23 UTC (rev 6035)
@@ -27,9 +27,6 @@
     year => '2012',
     genre => {
       name => '"Greatest" collections',
-      demographic => {
-        name => '"Greatest" collections demographic',
-      },
     },
     tags => [
       { tag => 'A' },
@@ -50,9 +47,6 @@
                       year => 2012,
                       genre => {
                         name => '"Greatest" collections',
-                        demographic => {
-                          name => '"Greatest" collections demographic',
-                        },
                       },
                       tags => [
                         { tag => 'A' },
@@ -74,9 +68,6 @@
                                     year => 2012,
                                     genre => {
                                       name => '"Greatest" collections',
-                                      demographic => {
-                                        name => '"Greatest" collections demographic',
-                                      },
                                     },
                                     tags => [
                                       { tag => 'A' },
@@ -88,9 +79,6 @@
                                     year => 2012,
                                     genre => {
                                       name => '"Greatest" collections2',
-                                      demographic => {
-                                        name => '"Greatest" collections demographic',
-                                      },
                                     },
                                     tags => [
                                       { tag => 'A' },
@@ -103,9 +91,6 @@
                               year => 2013,
                               genre => {
                                 name => '"Greatest" collections2',
-                                demographic => {
-                                  name => '"Greatest" collections demographic',
-                                },
                               },
                             }},
                           ],
@@ -118,9 +103,6 @@
                 year => 2012,
                 genre => {
                   name => '"Greatest" collections',
-                  demographic => {
-                    name => '"Greatest" collections demographic',
-                  },
                 },
                 tags => [
                   { tag => 'A' },

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm	2009-04-30 08:12:23 UTC (rev 6035)
@@ -38,7 +38,9 @@
 });
 
 # in case this is a single-cd it promotes a track from another cd
-__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track' );
+__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track', 'single_track', 
+    { join_type => 'left'} 
+);
 
 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
 __PACKAGE__->has_many(

Deleted: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Demographic.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Demographic.pm	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Demographic.pm	2009-04-30 08:12:23 UTC (rev 6035)
@@ -1,21 +0,0 @@
-package DBICTest::Schema::Demographic;
-
-use strict;
-
-use base 'DBIx::Class::Core';
-
-__PACKAGE__->table('demographic');
-__PACKAGE__->add_columns(
-    demographicid => {
-      data_type => 'integer',
-      is_auto_increment => 1,
-    },
-    name => {
-      data_type => 'varchar',
-      size => 100,
-    },
-);
-__PACKAGE__->set_primary_key('demographicid');
-__PACKAGE__->add_unique_constraint ( demographic_name => [qw/name/] );
-
-1;

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Genre.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Genre.pm	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Genre.pm	2009-04-30 08:12:23 UTC (rev 6035)
@@ -14,15 +14,10 @@
       data_type => 'varchar',
       size => 100,
     },
-    demographicid => {
-      data_type => 'integer',
-      is_nullable => 0,
-    },
 );
 __PACKAGE__->set_primary_key('genreid');
 __PACKAGE__->add_unique_constraint ( genre_name => [qw/name/] );
 
 __PACKAGE__->has_many (cds => 'DBICTest::Schema::CD', 'genreid');
-__PACKAGE__->belongs_to (demographic => 'DBICTest::Schema::Demographic', 'demographicid');
 
 1;

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm	2009-04-30 08:12:23 UTC (rev 6035)
@@ -11,7 +11,6 @@
   BindType
   Employee
   CD
-  Demographic
   FileColumn
   Genre
   Link

Modified: DBIx-Class/0.08/trunk/t/lib/sqlite.sql
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/sqlite.sql	2009-04-30 07:10:36 UTC (rev 6034)
+++ DBIx-Class/0.08/trunk/t/lib/sqlite.sql	2009-04-30 08:12:23 UTC (rev 6035)
@@ -1,6 +1,6 @@
 -- 
 -- Created by SQL::Translator::Producer::SQLite
--- Created on Sun Apr 19 11:49:48 2009
+-- Created on Thu Apr 30 10:04:57 2009
 -- 
 
 
@@ -137,16 +137,6 @@
 CREATE INDEX collection_object_idx_object_c ON collection_object (object);
 
 --
--- Table: demographic
---
-CREATE TABLE demographic (
-  demographicid INTEGER PRIMARY KEY NOT NULL,
-  name varchar(100) NOT NULL
-);
-
-CREATE UNIQUE INDEX demographic_name_demographic ON demographic (name);
-
---
 -- Table: employee
 --
 CREATE TABLE employee (
@@ -231,12 +221,9 @@
 --
 CREATE TABLE genre (
   genreid INTEGER PRIMARY KEY NOT NULL,
-  name varchar(100) NOT NULL,
-  demographicid integer NOT NULL
+  name varchar(100) NOT NULL
 );
 
-CREATE INDEX genre_idx_demographicid_genre ON genre (demographicid);
-
 CREATE UNIQUE INDEX genre_name_genre ON genre (name);
 
 --




More information about the Bast-commits mailing list