Skip to content

Commit

Permalink
Add comments to the unconvertible cases
Browse files Browse the repository at this point in the history
And clarify the `CREATE INDEX idx_name ON foo (bar NULLS)` case -
`NULLS` is used as an opclass here so give it a less misleading name.
  • Loading branch information
andrew-farries committed Dec 20, 2024
1 parent 8c50273 commit ca047c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/sql2pgroll/create_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,22 @@ func TestUnconvertableCreateIndexStatements(t *testing.T) {
t.Parallel()

tests := []string{
// More than one storage parameter is not supported
"CREATE INDEX idx_name ON foo (bar) WITH (fillfactor = 70, deduplicate_items = true)",
// Tablespaces are not supported
"CREATE INDEX idx_name ON foo (bar) TABLESPACE baz",
// Index collations are not supported
"CREATE INDEX idx_name ON foo (bar COLLATE en_US)",
// Index ordering other than the default ASC is not supported
"CREATE INDEX idx_name ON foo (bar DESC)",
// Index nulls ordering is not supported
"CREATE INDEX idx_name ON foo (bar NULLS FIRST)",
"CREATE INDEX idx_name ON foo (bar NULLS LAST)",
// Included columns are not supported
"CREATE INDEX idx_name ON foo (bar) INCLUDE (baz)",
// opclasses with or without options are not supported
"CREATE INDEX idx_name ON foo (bar opclass (test = test))",
"CREATE INDEX idx_name ON foo (bar NULLS)",

"CREATE INDEX idx_name ON foo (bar opclass)",
// TODO: Can't figure out how to detect this case
//"CREATE INDEX idx_name ON ONLY foo (bar)",
}
Expand Down

0 comments on commit ca047c2

Please sign in to comment.