X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FPg.pm;h=ccf6690eb89833308e46e72ce558003110127166;hb=2a1ff2eee1d8775ff8cca7144d6d36b24bb0605a;hp=0ed30709ed7dd7ca9eb487a05ab02da1aac82911;hpb=268cc2469d1405a421e64ff487c0f18d7d8ba9a1;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm index 0ed3070..ccf6690 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm @@ -41,6 +41,10 @@ sub _setup { if (not defined $self->preserve_case) { $self->preserve_case(0); } + elsif ($self->preserve_case) { + $self->schema->storage->sql_maker->quote_char('"'); + $self->schema->storage->sql_maker->name_sep('.'); + } } sub _table_uniq_info { @@ -228,9 +232,12 @@ EOF } # alias now() to current_timestamp for deploying to other DBs - if ((eval { lc ${ $info->{default_value} }||'') eq 'now()' }) { + if ((eval { lc ${ $info->{default_value} } }||'') eq 'now()') { # do not use a ref to a constant, that breaks Data::Dump output ${$info->{default_value}} = 'current_timestamp'; + + my $now = 'now()'; + $info->{original}{default_value} = \$now; } }