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

fix: migrator error of gorm on second run #137

Merged

Conversation

WaferJay
Copy link
Contributor

@WaferJay WaferJay commented Jul 7, 2024

See go-gorm/gorm#5409.

The solution is referenced from go-gorm/gorm#5409 (comment)

db, err := gorm.Open(postgres.New(postgres.Config{
  DSN: "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai", // data source name, refer https://github.com/jackc/pgx
  PreferSimpleProtocol: true, // disables implicit prepared statement usage. By default pgx automatically uses the extended protocol
}), &gorm.Config{})

Have a nice day. :-)

@@ -12,28 +11,13 @@ import (
const driverName = "postgres"
Copy link
Owner

@tiagorlampert tiagorlampert Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this constant can now be removed

Copy link
Owner

@tiagorlampert tiagorlampert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @WaferJay

@tiagorlampert tiagorlampert merged commit e371705 into tiagorlampert:main Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants