Implement adding unique constraint to column in PostgreSQL.

Removing the unique constraint still unimplemented.
This commit is contained in:
Mark Johnson
2015-05-07 17:20:41 -07:00
parent 009ad985a0
commit 3adbc2b807
@@ -109,7 +109,14 @@ public class PostgreSQLLiaison extends BaseLiaison
if (lbuf.length() > 0) {
lbuf.append(", ");
}
lbuf.append("unique=").append(unique).append(" (not implemented yet)");
lbuf.append("unique=").append(unique);
if (unique) {
executeQuery(
conn, "ALTER TABLE " + tableSQL(table) + "ADD UNIQUE (" +
columnSQL(column) + ")");
} else {
lbuf.append(" (not implemented yet)");
}
}
if (defaultValue != null) {
executeQuery(