We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49f0f31 commit 5d048ebCopy full SHA for 5d048eb
lib/SQL/Translator/Producer/PostgreSQL.pm
@@ -923,7 +923,13 @@ sub alter_create_index {
923
my ($index, $options) = @_;
924
my $generator = _generator($options);
925
my ($idef, $constraints) = create_index($index, $options);
926
- return $index->type eq NORMAL ? $idef
+
927
+ # Just like 90726ffd commit: don't run into output like this:
928
+ # ALTER TABLE users ADD ;
929
+ # create_index returns one of: index definition or constraint
930
931
+ # So define index or constraint
932
+ return $idef ? $idef
933
: sprintf('ALTER TABLE %s ADD %s',
934
$generator->quote($index->table->name),
935
join(q{}, @$constraints)
0 commit comments