fix: shop_players 关系表主键与模型对齐

This commit is contained in:
zetaloop
2026-04-04 06:25:49 +08:00
parent 3a81aec527
commit 7dc088eadf
18 changed files with 91 additions and 310 deletions
+4 -27
View File
@@ -410,12 +410,6 @@ func (c *ShopPlayersClient) UpdateOne(_m *ShopPlayers) *ShopPlayersUpdateOne {
return &ShopPlayersUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// UpdateOneID returns an update builder for the given id.
func (c *ShopPlayersClient) UpdateOneID(id int64) *ShopPlayersUpdateOne {
mutation := newShopPlayersMutation(c.config, OpUpdateOne, withShopPlayersID(id))
return &ShopPlayersUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// Delete returns a delete builder for ShopPlayers.
func (c *ShopPlayersClient) Delete() *ShopPlayersDelete {
mutation := newShopPlayersMutation(c.config, OpDelete)
@@ -424,13 +418,10 @@ func (c *ShopPlayersClient) Delete() *ShopPlayersDelete {
// DeleteOne returns a builder for deleting the given entity.
func (c *ShopPlayersClient) DeleteOne(_m *ShopPlayers) *ShopPlayersDeleteOne {
return c.DeleteOneID(_m.ID)
}
// DeleteOneID returns a builder for deleting the given entity by its id.
func (c *ShopPlayersClient) DeleteOneID(id int64) *ShopPlayersDeleteOne {
builder := c.Delete().Where(shopplayers.ID(id))
builder.mutation.id = &id
builder := c.Delete().Where(
shopplayers.ShopIDEQ(_m.ShopID),
shopplayers.PlayerIDEQ(_m.PlayerID),
)
builder.mutation.op = OpDeleteOne
return &ShopPlayersDeleteOne{builder}
}
@@ -444,20 +435,6 @@ func (c *ShopPlayersClient) Query() *ShopPlayersQuery {
}
}
// Get returns a ShopPlayers entity by its id.
func (c *ShopPlayersClient) Get(ctx context.Context, id int64) (*ShopPlayers, error) {
return c.Query().Where(shopplayers.ID(id)).Only(ctx)
}
// GetX is like Get, but panics if an error occurs.
func (c *ShopPlayersClient) GetX(ctx context.Context, id int64) *ShopPlayers {
obj, err := c.Get(ctx, id)
if err != nil {
panic(err)
}
return obj
}
// Hooks returns the client hooks.
func (c *ShopPlayersClient) Hooks() []Hook {
return c.hooks.ShopPlayers