Column default values: refactor handling, improve Pg reverse engineering and implemen...
[DBIx-DBSchema.git] / DBSchema.pm
index fb88ee3..a84246e 100644 (file)
@@ -4,13 +4,13 @@ use strict;
 use vars qw($VERSION $DEBUG $errstr);
 use Storable;
 use DBIx::DBSchema::_util qw(_load_driver _dbh _parse_opt);
-use DBIx::DBSchema::Table 0.05;
+use DBIx::DBSchema::Table 0.08;
 use DBIx::DBSchema::Index;
 use DBIx::DBSchema::Column;
 use DBIx::DBSchema::ColGroup::Unique;
 use DBIx::DBSchema::ColGroup::Index;
 
-$VERSION = "0.34";
+$VERSION = "0.37_04";
 $VERSION = eval $VERSION; # modperlstyle: convert the string into a number
 
 $DEBUG = 0;
@@ -276,7 +276,6 @@ specified database, will attempt to use generic SQL syntax.
 #gosh, false laziness w/DBSchema::Table::sql_alter_schema
 
 sub sql_update_schema {
-  #my($self, $new, $dbh) = ( shift, shift, _dbh(@_) );
   my($self, $opt, $new, $dbh) = ( shift, _parse_opt(\@_), shift, _dbh(@_) );
 
   my @r = ();
@@ -287,8 +286,10 @@ sub sql_update_schema {
   
       warn "$table exists\n" if $DEBUG > 1;
 
-      push @r,
-        $self->table($table)->sql_alter_table( $new->table($table), $dbh );
+      push @r, $self->table($table)->sql_alter_table( $new->table($table),
+                                                      $dbh,
+                                                      $opt
+                                                    );
 
     } else {
   
@@ -406,7 +407,7 @@ sub pretty_print {
                       ? "              'using'  => '". $index->using ."',\n"
                       : ''
                   ).
-                  "                   'unique'  => ". $index->_unique .",\n".
+                  "                   'unique'  => ". $index->unique .",\n".
                   "                   'columns' => [ '".
                                               join("', '", @{$index->columns} ).
                                               "' ],\n".
@@ -424,6 +425,9 @@ sub pretty_print {
 
 =item pretty_read HASHREF
 
+This method is B<not> recommended.  If you need to load and save your schema
+to a file, see the L</load|load> and L</save|save> methods.
+
 Creates a schema as specified by a data structure such as that created by
 B<pretty_print> method.
 
@@ -513,7 +517,7 @@ items/projects below under BUGS.
 
 Copyright (c) 2000-2007 Ivan Kohler
 Copyright (c) 2000 Mail Abuse Prevention System LLC
-Copyright (c) 2007 Freeside Internet Services, Inc.
+Copyright (c) 2007-2010 Freeside Internet Services, Inc.
 All rights reserved.
 This program is free software; you can redistribute it and/or modify it under
 the same terms as Perl itself.
@@ -524,9 +528,7 @@ Multiple primary keys are not yet supported.
 
 Foreign keys and other constraints are not yet supported.
 
-Eventually it would be nice to have additional transformations (deleted,
-modified columns).  sql_update_schema doesn't deal with deleted or modified
-columns yet.
+sql_update_schema doesn't deal with deleted columns yet.
 
 Need to port and test with additional databases