lichangdong há 1 semana atrás
pai
commit
0bda954ab4

+ 1 - 1
ent/addwechatfriendlog/addwechatfriendlog.go

@@ -36,7 +36,7 @@ const (
 	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
 	FieldUpdatedAt = "updated_at"
 	// Table holds the table name of the addwechatfriendlog in the database.
-	Table = "add_wechat_friend_logs"
+	Table = "add_wechat_friend_log"
 )
 
 // Columns holds all SQL columns for addwechatfriendlog fields.

+ 12 - 9
ent/migrate/schema.go

@@ -9,8 +9,8 @@ import (
 )
 
 var (
-	// AddWechatFriendLogsColumns holds the columns for the "add_wechat_friend_logs" table.
-	AddWechatFriendLogsColumns = []*schema.Column{
+	// AddWechatFriendLogColumns holds the columns for the "add_wechat_friend_log" table.
+	AddWechatFriendLogColumns = []*schema.Column{
 		{Name: "id", Type: field.TypeInt64, Increment: true},
 		{Name: "owner_wx_id", Type: field.TypeString, Size: 64, Default: ""},
 		{Name: "owner_wx_type", Type: field.TypeInt, Default: 1},
@@ -25,16 +25,16 @@ var (
 		{Name: "created_at", Type: field.TypeInt64},
 		{Name: "updated_at", Type: field.TypeInt64},
 	}
-	// AddWechatFriendLogsTable holds the schema information for the "add_wechat_friend_logs" table.
-	AddWechatFriendLogsTable = &schema.Table{
-		Name:       "add_wechat_friend_logs",
-		Columns:    AddWechatFriendLogsColumns,
-		PrimaryKey: []*schema.Column{AddWechatFriendLogsColumns[0]},
+	// AddWechatFriendLogTable holds the schema information for the "add_wechat_friend_log" table.
+	AddWechatFriendLogTable = &schema.Table{
+		Name:       "add_wechat_friend_log",
+		Columns:    AddWechatFriendLogColumns,
+		PrimaryKey: []*schema.Column{AddWechatFriendLogColumns[0]},
 		Indexes: []*schema.Index{
 			{
 				Name:    "addwechatfriendlog_owner_wx_id_is_can_add",
 				Unique:  false,
-				Columns: []*schema.Column{AddWechatFriendLogsColumns[1], AddWechatFriendLogsColumns[7]},
+				Columns: []*schema.Column{AddWechatFriendLogColumns[1], AddWechatFriendLogColumns[7]},
 			},
 		},
 	}
@@ -1615,7 +1615,7 @@ var (
 	}
 	// Tables holds all the tables in the schema.
 	Tables = []*schema.Table{
-		AddWechatFriendLogsTable,
+		AddWechatFriendLogTable,
 		AgentTable,
 		AgentBaseTable,
 		AliyunAvatarTable,
@@ -1667,6 +1667,9 @@ var (
 )
 
 func init() {
+	AddWechatFriendLogTable.Annotation = &entsql.Annotation{
+		Table: "add_wechat_friend_log",
+	}
 	AgentTable.Annotation = &entsql.Annotation{
 		Table: "agent",
 	}

+ 2 - 5
ent/schema/add_wechat_friend_log.go

@@ -2,6 +2,7 @@ package schema
 
 import (
 	"entgo.io/ent"
+	"entgo.io/ent/dialect/entsql"
 	"entgo.io/ent/schema"
 	"entgo.io/ent/schema/field"
 	"entgo.io/ent/schema/index"
@@ -73,11 +74,6 @@ func (AddWechatFriendLog) Fields() []ent.Field {
 	}
 }
 
-// TableName sets the custom table name.
-func (AddWechatFriendLog) TableName() string {
-	return "add_wechat_friend_log"
-}
-
 // Indexes of the AddWechatFriendLog.
 func (AddWechatFriendLog) Indexes() []ent.Index {
 	return []ent.Index{
@@ -88,5 +84,6 @@ func (AddWechatFriendLog) Indexes() []ent.Index {
 func (AddWechatFriendLog) Annotations() []schema.Annotation {
 	return []schema.Annotation{
 		schema.Comment("微信添加好友记录"),
+		entsql.Annotation{Table: "add_wechat_friend_log"},
 	}
 }