Skip to content

Commit

Permalink
Adapt table DDL generator to deal with new UNIQUE NULLS NOT DISTINCT …
Browse files Browse the repository at this point in the history
…key_type.
  • Loading branch information
mvdvm committed May 30, 2024
1 parent e03dfa8 commit 2e54300
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/monetdb/util/SQLExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,12 @@ public void dumpSchema(
final String idxname = cols.getString(colIndexNm);
if (idxname != null && !idxname.endsWith("_pkey")) {
out.println(",");
out.print("\tCONSTRAINT " + dq(idxname) + " UNIQUE (" + dq(cols.getString(colNmIndex)));
out.print("\tCONSTRAINT " + dq(idxname));
if (idxname.endsWith("_nndunique"))
out.print(" UNIQUE NULLS NOT DISTINCT ("); // new since release 11.50 (Aug2024)
else
out.print(" UNIQUE (");
out.print(dq(cols.getString(colNmIndex)));

boolean next;
while ((next = cols.next()) && idxname.equals(cols.getString(colIndexNm))) {
Expand Down

0 comments on commit 2e54300

Please sign in to comment.