X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FInterBase.pm;h=19f332f4b6e574a8dfb8c1314aae15f9d083d90d;hb=701cd3e37c8b4119cf43454d22766c1196377a3c;hp=e24ec85effc1907895cb2fc326e12fd9655c081a;hpb=5afd3e723f5c9644e67f9b623b069f870e94fdc9;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm index e24ec85..19f332f 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm @@ -8,11 +8,7 @@ use base qw/DBIx::Class::Schema::Loader::DBI/; use Carp::Clan qw/^DBIx::Class/; use List::Util 'first'; -__PACKAGE__->mk_group_ro_accessors('simple', qw/ - unquoted_ddl -/); - -our $VERSION = '0.06001'; +our $VERSION = '0.07000'; =head1 NAME @@ -21,54 +17,55 @@ Firebird Implementation. =head1 DESCRIPTION -See L for available options. +See L and L. + +=head1 COLUMN NAME CASE ISSUES By default column names from unquoted DDL will be generated in uppercase, as that is the only way they will work with quoting on. -See the L option in this driver if you would like to have -lowercase column names. - -=head1 DRIVER OPTIONS +See the L option +to false if you would like to have lowercase column names. -=head2 unquoted_ddl - -Set this loader option if your DDL uses unquoted identifiers and you will not -use quoting (the L option in +Setting this option is a good idea if your DDL uses unquoted identifiers and +you will not use quoting (the +L option in L.) +Be careful to also not use any SQL reserved words in your DDL. + This will generate lowercase column names (as opposed to the actual uppercase names) in your Result classes that will only work with quoting off. Mixed-case table and column names will be ignored when this option is on and will not work with quoting turned off. -=cut +B This option used to be called C but has been removed in +favor of the more generic option. -sub _is_case_sensitive { - my $self = shift; - - return $self->unquoted_ddl ? 0 : 1; -} +=cut sub _setup { my $self = shift; - $self->next::method; - - $self->schema->storage->sql_maker->name_sep('.'); + $self->next::method(@_); - if (not defined $self->unquoted_ddl) { + if (not defined $self->preserve_case) { warn <<'EOF'; -WARNING: Assuming mixed-case Firebird DDL, see the unquoted_ddl option in +WARNING: Assuming mixed-case Firebird DDL, see perldoc DBIx::Class::Schema::Loader::DBI::InterBase +and the 'preserve_case' option in +perldoc DBIx::Class::Schema::Loader::Base for more information. EOF + $self->preserve_case(1); } - if (not $self->unquoted_ddl) { + $self->schema->storage->sql_maker->name_sep('.'); + + if ($self->preserve_case) { $self->schema->storage->sql_maker->quote_char('"'); } else { @@ -76,18 +73,6 @@ EOF } } -sub _lc { - my ($self, $name) = @_; - - return $self->unquoted_ddl ? lc($name) : $name; -} - -sub _uc { - my ($self, $name) = @_; - - return $self->unquoted_ddl ? uc($name) : $name; -} - sub _table_pk_info { my ($self, $table) = @_; @@ -272,9 +257,6 @@ EOF elsif ($info->{data_type} eq 'character') { $info->{data_type} = 'char'; } - elsif ($info->{data_type} eq 'real') { - $info->{data_type} = 'float'; - } elsif ($info->{data_type} eq 'int64' || $info->{data_type} eq '-9581') { # the constant is just in case, the query should pick up the type $info->{data_type} = 'bigint'; @@ -308,6 +290,9 @@ EOF $info->{default_value} = $def =~ /^\d/ ? $def : \$def; } } + + ${ $info->{default_value} } = 'current_timestamp' + if ref $info->{default_value} && ${ $info->{default_value} } eq 'CURRENT_TIMESTAMP'; } return $result;