Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/SQL/Translator/Producer/PostgreSQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,13 @@ sub alter_create_index {
my ($index, $options) = @_;
my $generator = _generator($options);
my ($idef, $constraints) = create_index($index, $options);
return $index->type eq NORMAL

# Just like 90726ffd commit: don't run into output like this:
# ALTER TABLE users ADD ;
# create_index returns one of: index definition or constraint

# So define index or constraint
return $idef
? $idef
: sprintf('ALTER TABLE %s ADD %s', $generator->quote($index->table->name), join(q{}, @$constraints));
}
Expand Down
Loading