fix: 复合主键表改为单字段 id 以支持 ent 完整生成

This commit is contained in:
zetaloop
2026-04-24 07:32:52 +08:00
parent c62d743320
commit 5ad579f03c
19 changed files with 324 additions and 82 deletions
+2 -2
View File
@@ -31,11 +31,11 @@ func init() {
shopplayersFields := schema.ShopPlayers{}.Fields()
_ = shopplayersFields
// shopplayersDescIsPrimary is the schema descriptor for is_primary field.
shopplayersDescIsPrimary := shopplayersFields[2].Descriptor()
shopplayersDescIsPrimary := shopplayersFields[3].Descriptor()
// shopplayers.DefaultIsPrimary holds the default value on creation for the is_primary field.
shopplayers.DefaultIsPrimary = shopplayersDescIsPrimary.Default.(bool)
// shopplayersDescJoinedAt is the schema descriptor for joined_at field.
shopplayersDescJoinedAt := shopplayersFields[3].Descriptor()
shopplayersDescJoinedAt := shopplayersFields[4].Descriptor()
// shopplayers.DefaultJoinedAt holds the default value on creation for the joined_at field.
shopplayers.DefaultJoinedAt = shopplayersDescJoinedAt.Default.(func() time.Time)
shopsFields := schema.Shops{}.Fields()