# -----------------------------------------------------------
+# 0.08_03
+# -----------------------------------------------------------
+
+* Added patch to use default values for Pg timestamp fields
+
+# -----------------------------------------------------------
+# 0.08_02 2006-11-03
+# -----------------------------------------------------------
+
+* Added patch from Ash to separate DROP statements in mysql producer in list-context
+* Fixed up SQLites usage of no-comments
+
+# -----------------------------------------------------------
# 0.08_01 2006-07-23
# -----------------------------------------------------------
package SQL::Translator::Producer::PostgreSQL;
# -------------------------------------------------------------------
-# $Id: PostgreSQL.pm,v 1.25 2006-08-04 21:38:20 schiffbruechige Exp $
+# $Id: PostgreSQL.pm,v 1.26 2006-11-09 18:16:24 schiffbruechige Exp $
# -------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use strict;
use warnings;
use vars qw[ $DEBUG $WARN $VERSION ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.25 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.26 $ =~ /(\d+)\.(\d+)/;
$DEBUG = 1 unless defined $DEBUG;
use SQL::Translator::Schema::Constants;
#
# Default value -- disallow for timestamps
#
- my $default = $data_type =~ /(timestamp|date)/i
- ? undef : $field->default_value;
+# my $default = $data_type =~ /(timestamp|date)/i
+# ? undef : $field->default_value;
+ my $default = $field->default_value;
if ( defined $default ) {
+ my $qd = "'";
+ $qd = '' if ($default eq 'now()' ||
+ $default eq 'CURRENT_TIMESTAMP');
$field_def .= sprintf( ' DEFAULT %s',
( $field->is_auto_increment && $seq_name )
? qq[nextval('"$seq_name"'::text)] :
- ( $default =~ m/null/i ) ? 'NULL' : "'$default'"
+ ( $default =~ m/null/i ) ? 'NULL' : "$qd$default$qd"
);
}