Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No autoincrement for serial column #81

Closed
madskrogh opened this issue Feb 22, 2022 · 1 comment
Closed

No autoincrement for serial column #81

madskrogh opened this issue Feb 22, 2022 · 1 comment
Assignees

Comments

@madskrogh
Copy link

GORM Playground Link

go-gorm/playground#439

Description

Upgrading from gorm v1.22.5 columns of type serial does not appear to increment appropriately. According to the logs, with the new version of gorm and the gorm postgres driver, 0 is inserted in the serial column as opposed to the previous version where nothing is inserted and the column default sequence is correctly used.

  • gorm v1.3.0, postgress driver v1.3.0: INSERT INTO "tests" ("created_at","updated_at","deleted_at") VALUES ('2022-02-22 12:51:00.618','2022-02-22 12:51:00.618',NULL) RETURNING "id"

  • gorm v1.22.5, postgress driver v1.2.3: INSERT INTO "tests" ("id","created_at","updated_at","deleted_at") VALUES (0,'2022-02-22 12:52:02.765','2022-02-22 12:52:02.765',NULL)

@madskrogh
Copy link
Author

Replaced by go-gorm/gorm#5105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants