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
@@ -11,6 +11,8 @@ import (
const (
// Label holds the string label denoting the shopplayers type in the database.
Label = "shop_players"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldShopID holds the string denoting the shop_id field in the database.
FieldShopID = "shop_id"
// FieldPlayerID holds the string denoting the player_id field in the database.
@@ -27,6 +29,7 @@ const (
// Columns holds all SQL columns for shopplayers fields.
var Columns = []string{
FieldID,
FieldShopID,
FieldPlayerID,
FieldIsPrimary,
@@ -54,6 +57,11 @@ var (
// OrderOption defines the ordering options for the ShopPlayers queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByShopID orders the results by the shop_id field.
func ByShopID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldShopID, opts...).ToFunc()