[Bast-commits] r3692 - DBIx-Class/0.08/branches/versioned_enhancements/lib/DBIx/Class/Schema

captainL at dev.catalyst.perl.org captainL at dev.catalyst.perl.org
Tue Aug 21 17:58:18 GMT 2007


Author: captainL
Date: 2007-08-21 17:58:17 +0100 (Tue, 21 Aug 2007)
New Revision: 3692

Modified:
   DBIx-Class/0.08/branches/versioned_enhancements/lib/DBIx/Class/Schema/Versioned.pm
Log:
determines parser from dbh driver name and gives parser the dbh from schema to connect

Modified: DBIx-Class/0.08/branches/versioned_enhancements/lib/DBIx/Class/Schema/Versioned.pm
===================================================================
--- DBIx-Class/0.08/branches/versioned_enhancements/lib/DBIx/Class/Schema/Versioned.pm	2007-08-21 16:37:53 UTC (rev 3691)
+++ DBIx-Class/0.08/branches/versioned_enhancements/lib/DBIx/Class/Schema/Versioned.pm	2007-08-21 16:58:17 UTC (rev 3692)
@@ -143,16 +143,6 @@
     $self->storage->backup($self->backup_directory());
 }
 
-sub _generate_db_schema
-{
-    my ($self) = @_;
-
-
-    
-
-
-
-}
 sub upgrade
 {
     my ($self) = @_;
@@ -172,15 +162,10 @@
 
       require SQL::Translator;
       require SQL::Translator::Diff;
-
       my $db_tr = SQL::Translator->new({ 
         add_drop_table => 1, 
         parser => 'DBI',
-        parser_args => { 
-          dsn => 'dbi:mysql:dbname=takkle_test', 
-          db_user => 'newtakkle', 
-          db_password => 'takkle123' 
-          } 
+        parser_args => { dbh => $self->storage->dbh }
       });
 
       $db_tr->producer($db);      
@@ -190,10 +175,9 @@
       $dbic_tr->data($self);
       $dbic_tr->producer($db);
 
-      $db_tr->schema->name('1');
-      $dbic_tr->schema->name('2');
+      $db_tr->schema->name('db_schema');
+      $dbic_tr->schema->name('dbic_schema');
 
-
       # is this really necessary?
       foreach my $tr ($db_tr, $dbic_tr) {
         my $data = $tr->data;
@@ -219,7 +203,10 @@
       print $file $diff;
       close($file);
 
-      print "WARNING: There may be differences between your DB and your DBIC schema. Please review and if necessary run the SQL $filename to sync your DB.\n";
+      # create versions table
+      $self->{vschema}->deploy;
+
+      print "WARNING: There may be differences between your DB and your DBIC schema. Please review and if necessary run the SQL in $filename to sync your DB.\n";
     } else {
       my $file = $self->ddl_filename(
                                  $self->storage->sqlt_type,




More information about the Bast-commits mailing list