0.29! DBIx_DBSchema_0_29
authorivan <ivan>
Thu, 16 Feb 2006 21:55:17 +0000 (21:55 +0000)
committerivan <ivan>
Thu, 16 Feb 2006 21:55:17 +0000 (21:55 +0000)
Changes
DBSchema.pm
DBSchema/Column.pm
TODO [deleted file]
debian/changelog
debian/files
debian/rules

diff --git a/Changes b/Changes
index 5a9a1e0..2166665 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,10 +1,12 @@
 Revision history for Perl extension DBIx::DBSchema.
 
-0.29 Thu Feb 16 06:12:42 PST 2006
+0.29 Thu Feb 16 13:54:42 PST 2006
        - Column::sql_add_column fix when adding primary keys to Pg 7.2.x
        - workaround for PAUSE parsing of DBIx::DBSchema::DBD::Pg version: move
          DBD::Pg verison checking after $VERSION declaration, thanks Andreas!
-       - allow setting an empty default value
+       - kludge: allow scalar ref default to force quoting off, to add things
+         like functions and empty values as defaults
+       - Move TODO file to DBSchema.pm and DBS/Column.pm BUGS sections
 
 0.28 Wed Nov 30 09:46:47 PST 2005
         - Initial SQLite support from Jesse Vincent
index 6e0167a..aa13d4e 100644 (file)
@@ -323,16 +323,25 @@ sub _tables_from_dbh {
 
 =back
 
-=head1 AUTHOR
+=head1 AUTHORS
 
 Ivan Kohler <ivan-dbix-dbschema@420.am>
 
 Charles Shapiro <charles.shapiro@numethods.com> and Mitchell Friedman
 <mitchell.friedman@numethods.com> contributed the start of a Sybase driver.
 
+Daniel Hanks <hanksdc@about-inc.com> contributed the Oracle driver.
+
+Jesse Vincent contributed the SQLite driver.
+
+=head1 CONTRIBUTIONS
+
+Contributions are welcome!  I'm especially keen on any interest in the first
+three items/projects below under BUGS.
+
 =head1 COPYRIGHT
 
-Copyright (c) 2000-2005 Ivan Kohler
+Copyright (c) 2000-2006 Ivan Kohler
 Copyright (c) 2000 Mail Abuse Prevention System LLC
 All rights reserved.
 This program is free software; you can redistribute it and/or modify it under
@@ -340,6 +349,18 @@ the same terms as Perl itself.
 
 =head1 BUGS
 
+Indices are not stored by name.  Index representation could use an overhaul.
+
+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, added/modified/indices (probably need em named first),
+added/deleted tables
+
+Need to port and test with additional databases
+
 Each DBIx::DBSchema object should have a name which corresponds to its name
 within the SQL database engine (DBI data source).
 
@@ -348,6 +369,10 @@ pretty_print is actually pretty ugly.
 Perhaps pretty_read should eval column types so that we can use DBI
 qw(:sql_types) here instead of externally.
 
+sql CREATE TABLE output should convert integers
+(i.e. use DBI qw(:sql_types);) to local types using DBI->type_info plus a hash
+to fudge things
+
 =head1 SEE ALSO
 
 L<DBIx::DBSchema::Table>, L<DBIx::DBSchema::ColGroup>,
index 38afbf1..0971f01 100644 (file)
@@ -25,7 +25,7 @@ DBIx::DBSchema::Column - Column objects
     'type'    => 'varchar'
     'null'    => 'NOT NULL',
     'length'  => 64,
-    'default' => '
+    'default' => '',
     'local'   => '',
   } );
 
@@ -76,6 +76,9 @@ rules for truth, with one exception: `NOT NULL' is false).  B<length> is the
 SQL length of the column.  B<default> is the default value of the column.
 B<local> is reserved for database-specific information.
 
+Note: If you pass a scalar reference as the B<default> rather than a scalar value, it will be dereferenced and quoting will be forced off.  This can be used to pass SQL functions such as C<$now()> or explicit empty strings as C<''> as
+defaults.
+
 =cut
 
 sub new {
@@ -261,7 +264,8 @@ sub line {
   my $null = $self->null;
 
   my $default;
-  if ( defined($self->default) && ref($dbh)
+  if ( defined($self->default) && !ref($self->default) && $self->default ne ''
+       && ref($dbh)
        # false laziness: nicked from FS::Record::_quote
        && ( $self->default !~ /^\-?\d+(\.\d+)?$/
             || $type =~ /(char|binary|blob|text)$/i
@@ -269,7 +273,9 @@ sub line {
   ) {
     $default = $dbh->quote($self->default);
   } else {
-    $default = $self->default;
+    warn "*** ref pointing to data: ". ${$self->default}
+      if $ref($self->default);
+    $default = ref($self->default) ? ${$self->default} : $self->default;
   }
 
   #this should be a callback into the driver
@@ -429,6 +435,8 @@ the same terms as Perl itself.
 
 =head1 BUGS
 
+Better documentation is needed for sql_add_column
+
 line() and sql_add_column() hav database-specific foo that should be abstracted
 into the DBIx::DBSchema:DBD:: modules.
 
diff --git a/TODO b/TODO
deleted file mode 100644 (file)
index c1136fc..0000000
--- a/TODO
+++ /dev/null
@@ -1,16 +0,0 @@
-named indices (index representation needs an overhaul)
-
-multiple primary keys (oracle, db2, others?)
-
-foreign keys and other constraints
-
-better documentation for Column::sql_add_column
-
-Additional transformations (deleted, modified columns, added/modified/indices
-(probably need em named first), added/deleted tables
-
-port and test with additional databases
-
-sql CREATE TABLE output should convert integers
-(i.e. use DBI qw(:sql_types);) to local types using DBI->type_info plus a hash
-to fudge things
index e83f334..d5d3929 100644 (file)
@@ -1,6 +1,6 @@
 libdbix-dbschema-perl (0.29-1) unstable; urgency=low
 
-  * new upstream release (closes: Bug#342490)
+  * new upstream release
 
  -- Ivan Kohler <ivan-debian@420.am>  Thu, 16 Feb 2006 06:19:29 -0800
 
index 8dfe287..ac0ce4d 100644 (file)
@@ -1 +1 @@
-libdbix-dbschema-perl_0.27-1_all.deb perl optional
+libdbix-dbschema-perl_0.29-1_all.deb perl optional
index 8df15d7..62b057b 100755 (executable)
@@ -59,7 +59,7 @@ binary-indep: build install
 #      dh_testversion
        dh_testdir
        dh_testroot
-       dh_installdocs README TODO
+       dh_installdocs README
        dh_installexamples
        dh_installmenu
 #      dh_installemacsen