upgrade sql should work now
Arthur Axel 'fREW' Schmidt [Sat, 27 Mar 2010 08:28:53 +0000 (03:28 -0500)]
lib/DBIx/Class/DeploymentHandler/Dad.pm
lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm

index 2c19b3d..d1a4f83 100644 (file)
@@ -62,18 +62,22 @@ method install {
 sub upgrade {
   my $self = shift;
   while ( my $version_list = $self->next_version_set ) {
-    $self->_upgrade_single_step($version_list);
+    my ($ddl, $upgrade_sql) = @{$self->_upgrade_single_step($version_list)||[]};
 
     $self->add_database_version({
       version     => $version_list->[-1],
-      # ddl         => $ddl,
-      # upgrade_sql => $upgrade_sql,
+      ddl         => $ddl,
+      upgrade_sql => $upgrade_sql,
     });
   }
 }
 
 method backup { $self->storage->backup($self->backup_directory) }
 
+method deploy_version_storage {
+  $self->
+}
+
 __PACKAGE__->meta->make_immutable;
 
 1;
index 00953d8..92f54b5 100644 (file)
@@ -372,12 +372,16 @@ sub _upgrade_single_step {
     \@version_set,
   )};
 
+  my $upgrade_sql;
   for my $upgrade_file (@upgrade_files) {
-    $self->_filedata($self->_read_sql_file($upgrade_file)); # I don't like this --fREW 2010-02-22
+    my $up = $self->_read_sql_file($upgrade_file);
+    $upgrade_sql .= $up;
+    $self->_filedata($up); # I don't like this --fREW 2010-02-22
     my $guard = $self->schema->txn_scope_guard if $self->txn_wrap;
     $self->_do_upgrade;
     $guard->commit if $self->txn_wrap;
   }
+  return ['', $upgrade_sql];
 }
 
 method _do_upgrade { $self->_run_upgrade(qr/.*?/) }