[Bast-commits] r5086 - in DBIx-Class/0.08/trunk/lib: DBIx/Class DBIx/Class/Storage SQL/Translator/Parser/DBIx

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sun Nov 9 20:19:39 GMT 2008


Author: ribasushi
Date: 2008-11-09 20:19:39 +0000 (Sun, 09 Nov 2008)
New Revision: 5086

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
   DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm
Log:
Switch schema management version calls from VERSION() to schema_version()

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm	2008-11-09 16:02:05 UTC (rev 5085)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm	2008-11-09 20:19:39 UTC (rev 5086)
@@ -1054,7 +1054,7 @@
 
 =item databases  - ['MySQL', 'SQLite', 'PostgreSQL']
 
-=item version    - $schema->VERSION
+=item version    - $schema->schema_version
 
 =item directory  - './'
 

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm	2008-11-09 16:02:05 UTC (rev 5085)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm	2008-11-09 20:19:39 UTC (rev 5086)
@@ -1579,7 +1579,10 @@
   }
   $databases ||= ['MySQL', 'SQLite', 'PostgreSQL'];
   $databases = [ $databases ] if(ref($databases) ne 'ARRAY');
-  $version ||= $schema->VERSION || '1.x';
+
+  my $schema_version = $schema->schema_version || '1.x';
+  $version ||= $schema_version;
+
   $sqltargs = {
     add_drop_table => 1, 
     ignore_constraint_names => 1,
@@ -1604,7 +1607,7 @@
 
     my $file;
     my $filename = $schema->ddl_filename($db, $version, $dir);
-    if (-e $filename && (!$version || ($version == $schema->schema_version()))) {
+    if (-e $filename && ($version eq $schema_version )) {
       # if we are dumping the current version, overwrite the DDL
       warn "Overwriting existing DDL file - $filename";
       unlink($filename);
@@ -1721,7 +1724,7 @@
   # Need to be connected to get the correct sqlt_type
   $self->ensure_connected() unless $type;
   $type ||= $self->sqlt_type;
-  $version ||= $schema->VERSION || '1.x';
+  $version ||= $schema->schema_version || '1.x';
   $dir ||= './';
   my $filename = $schema->ddl_filename($type, $dir, $version);
   if(-f $filename)

Modified: DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm	2008-11-09 16:02:05 UTC (rev 5085)
+++ DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm	2008-11-09 20:19:39 UTC (rev 5086)
@@ -44,7 +44,7 @@
     my $schema      = $tr->schema;
     my $table_no    = 0;
 
-    $schema->name( ref($dbicschema) . " v" . ($dbicschema->VERSION || '1.x'))
+    $schema->name( ref($dbicschema) . " v" . ($dbicschema->schema_version || '1.x'))
       unless ($schema->name);
 
     my %seen_tables;




More information about the Bast-commits mailing list