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
=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
=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).
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>,
'type' => 'varchar'
'null' => 'NOT NULL',
'length' => 64,
- 'default' => '
+ 'default' => '',
'local' => '',
} );
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 {
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
) {
$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
=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.
+++ /dev/null
-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
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
-libdbix-dbschema-perl_0.27-1_all.deb perl optional
+libdbix-dbschema-perl_0.29-1_all.deb perl optional
# dh_testversion
dh_testdir
dh_testroot
- dh_installdocs README TODO
+ dh_installdocs README
dh_installexamples
dh_installmenu
# dh_installemacsen