Skip to content

composite key auto-increment returned 0 upon Create of new record #4930

@nash90

Description

@nash90

GORM Playground Link

go-gorm/playground#417

Description

Use Case:
Define table with multiple primary keys (composite key)
Upon New record insert, Get ID of autoIncrement enabled field.

Issue:
0 returned for autoIncrement enabled field. (Only when the model has 2 fields using primarykey tag)

Example:
Model Defined
image

Test Case:
image

Test Result:
image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions