出现问题无法正常启动项目的版本

gorm.io/datatypes v1.2.0
gorm.io/gen v0.3.23
gorm.io/gorm v1.25.5
gorm.io/plugin/dbresolver v1.4.7
gorm.io/driver/mysql v1.5.2 // indirect
gorm.io/driver/postgres v1.5.3 // indirect
gorm.io/hints v1.1.2 // indirect

出现问题的日志


2023/10/23 12:21:04 /xxx/orm/query/mini_user_golden_bean_log.gen.go:26
[error] failed to parse nextval('mini_user_golden_bean_log_id_seq1' as default value for int, got error: strconv.ParseInt: parsing "nextval('mini_user_golden_bean_log_id_seq1'": invalid syntax
panic: Cannot parse model: &{ID:0 OperationUserID: AgentUserID: MerchantUserID: UserID: Quantity:0 Type: Remark: RemarkPrivacy: OrderID: OrderType: HistoryBalance:0 NewBalance:0 CreatedAt:0001-01-01 00:00:00 +0000 UTC DeletedAt:{Time:0001-01-01 00:00:00 +0000 UTC Valid:false} CreatedIP: AppUserID: AttributionUserID: TypeDesc: OrderTypeDesc: Profit:0 RelationUserID: SuperiorUserID: CreatedIPInfo: HistoryQuota:0 NewQuota:0 LogDesc:}
failed to parse nextval('mini_user_golden_bean_log_id_seq1' as default value for int, got error: strconv.ParseInt: parsing "nextval('mini_user_golden_bean_log_id_seq1'": invalid syntax

goroutine 1 [running]:
gorm.io/gen.(*DO).UseModel(0x1400783a270, {0x1042f4de0, 0x140006ff040})
       /xxx/vendor/gorm.io/gen/do.go:83 +0x108
xxx/internal/orm/query.newMiniUserGoldenBeanLog(_, {_, _, _})
        /xxx/internal/orm/query/mini_user_golden_bean_log.gen.go:26 +0xb0
xxx/internal/orm/query.Use(0x140001e21e0, {0x0, 0x0, 0x0})
        /xxx/internal/orm/query/gen.go:611 +0x1c4c
xxx/internal/orm/query.SetDefault(0x140001df7a0?, {0x0?, 0x8bb2c97000?, 0x140004a50a0?})
        /xxx/internal/orm/query/gen.go:269 +0x20


使用replace替换能正常启动项目的版本

replace gorm.io/gorm => gorm.io/gorm v1.25.4
replace gorm.io/driver/mysql => gorm.io/driver/mysql v1.5.1
replace gorm.io/driver/postgres => gorm.io/driver/postgres v1.5.2

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: dtapps

数据库PostgreSQL13.4

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking