use strict;
use warnings;
our ( $DEBUG, $WARN );
-our $VERSION = '1.59';
+our $VERSION = '1.60';
$DEBUG = 0 unless defined $DEBUG;
use base qw(SQL::Translator::Producer);
#
if (is_geometry($field)) {
foreach ( create_geometry_constraints($field, $options) ) {
- my ($cdefs, $fks) = create_constraint($_, {
- generator => $generator,
- });
+ my ($cdefs, $fks) = create_constraint($_, $options);
push @$constraint_defs, @$cdefs;
push @$fks, @$fks;
}
$data_type = 'character varying';
}
elsif ( $field->is_auto_increment ) {
- if ( defined $size[0] && $size[0] > 11 ) {
+ if ( (defined $size[0] && $size[0] > 11) or $data_type eq 'bigint' ) {
$data_type = 'bigserial';
}
else {
sub alter_create_index {
my ($index, $options) = @_;
my $generator = _generator($options);
- my ($idef, $constraints) = create_index($index, {
- generator => $generator,
- });
+ my ($idef, $constraints) = create_index($index, $options);
return $index->type eq NORMAL ? $idef
: sprintf('ALTER TABLE %s ADD %s',
$generator->quote($index->table->name),