[jOOQ/jOOQ#8528] Prevent duplicate identities in interpreter

This commit is contained in:
Lukas Eder 2019-12-12 15:48:02 +01:00
parent 52b8980373
commit ce43c415c1

View File

@ -661,6 +661,8 @@ final class DDLInterpreter {
for (MutableField mf : existing.fields)
if (mf.nameEquals(field.name()))
throw columnAlreadyExists(field.qualifiedName());
else if (mf.type.identity() && dataType.identity())
throw new DataDefinitionException("Table can only have one identity: " + mf.qualifiedName());
if (index == Integer.MAX_VALUE)
existing.fields.add(field);