-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Error when Create New Database Record #6615
Comments
It seems like there is something wrong about type changing,trying to check if struct column type is what you expected |
Is there any real usage scenario? |
i created postgres database using migration scripts then use GORM to create the structs then when try to insert any record in the database this error is occured |
I'm wondering if the I also hit a similar issue. I'm trying to use it in PostgreSQL on an existing table when migrating a Java app to Go, the default value of ID is not set in the table, but it's controlled in Hibernate instead
But when I try to create a token
It does not generate TokenId automatically, but reports ERROR: null value in column "token_id" of relation "token" violates not-null constraint. |
@southwolf Not currently supported |
Thanks for confirming. Now I am using a workaround
|
GORM Playground Link
go-gorm/playground#650
Description
i got the following error "failed to parse nextval(' as default value for int, got error: strconv.ParseInt: parsing "nextval('": invalid syntax
0 failed to parse nextval(' as default value for int, got error: strconv.ParseInt: parsing "nextval('": invalid syntax" when try to create new record in the database i used GORM gen to generate the models and use them when create the database record
The text was updated successfully, but these errors were encountered: