projects
/
DBIx-DBSchema.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
consolidate multiple ALTER TABLE statements for efficiency, modernize deb packaging...
[DBIx-DBSchema.git]
/
DBSchema.pm
diff --git
a/DBSchema.pm
b/DBSchema.pm
index
c91d0b3
..
c55b823
100644
(file)
--- a/
DBSchema.pm
+++ b/
DBSchema.pm
@@
-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 vars qw($VERSION $DEBUG $errstr);
use Storable;
use DBIx::DBSchema::_util qw(_load_driver _dbh _parse_opt);
-use DBIx::DBSchema::Table 0.0
5
;
+use DBIx::DBSchema::Table 0.0
8
;
use DBIx::DBSchema::Index;
use DBIx::DBSchema::Column;
use DBIx::DBSchema::ColGroup::Unique;
use DBIx::DBSchema::ColGroup::Index;
use DBIx::DBSchema::Index;
use DBIx::DBSchema::Column;
use DBIx::DBSchema::ColGroup::Unique;
use DBIx::DBSchema::ColGroup::Index;
-$VERSION = "0.
37_04
";
+$VERSION = "0.
41_01
";
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
$DEBUG = 0;
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
$DEBUG = 0;
@@
-250,7
+250,7
@@
with B<drop_tables> set true before all other arguments, it will also drop
tables.
See L<DBIx::DBSchema::Table/sql_alter_table>,
tables.
See L<DBIx::DBSchema::Table/sql_alter_table>,
-L<DBIx::DBSchema::Column/sql_add_coumn> and
+L<DBIx::DBSchema::Column/sql_add_co
l
umn> and
L<DBIx::DBSchema::Column/sql_alter_column> for additional specifics and
limitations.
L<DBIx::DBSchema::Column/sql_alter_column> for additional specifics and
limitations.
@@
-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 {
#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 = ();
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;
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 {
} else {
@@
-370,7
+371,12
@@
sub pretty_print {
"'". $table->column($_)->type. "', ".
"'". $table->column($_)->null. "', ".
"'". $table->column($_)->length. "', ".
"'". $table->column($_)->type. "', ".
"'". $table->column($_)->null. "', ".
"'". $table->column($_)->length. "', ".
- "'". $table->column($_)->default. "', ".
+
+ ( ref($table->column($_)->default)
+ ? "\\'". ${ $table->column($_)->default }. "'"
+ : "'". $table->column($_)->default. "'"
+ ).', '.
+
"'". $table->column($_)->local. "',\n"
} $table->columns
).
"'". $table->column($_)->local. "',\n"
} $table->columns
).
@@
-516,7
+522,7
@@
items/projects below under BUGS.
Copyright (c) 2000-2007 Ivan Kohler
Copyright (c) 2000 Mail Abuse Prevention System LLC
Copyright (c) 2000-2007 Ivan Kohler
Copyright (c) 2000 Mail Abuse Prevention System LLC
-Copyright (c) 2007 Freeside Internet Services, Inc.
+Copyright (c) 2007
-2013
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.
All rights reserved.
This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
@@
-527,9
+533,7
@@
Multiple primary keys are not yet supported.
Foreign keys and other constraints 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
Need to port and test with additional databases