Generated tables Table#primaryKey() will return string representation of first field name instead of primary key variable name

This commit is contained in:
Collin Smith 2021-01-08 19:02:37 -08:00
parent 2ab7c7ceb0
commit 27e94d8122

View File

@ -140,7 +140,7 @@ class TableCodeGenerator extends CodeGenerator {
context.typeUtils)
.addStatement("return $L", config.indexed()
? null
: CodeBlock.of("$S", schemaElement.primaryKeyFieldElement.element))
: CodeBlock.of("$S", schemaElement.primaryKeyFieldElement.fieldNames[0]))
.build();
}
}