Browse Source

修改表名

DESKTOP-53URE31\USER 8 months ago
parent
commit
8d2f34a75a
2 changed files with 12 additions and 12 deletions
  1. 1 1
      ent/batchmsg/batchmsg.go
  2. 11 11
      ent/migrate/schema.go

+ 1 - 1
ent/batchmsg/batchmsg.go

@@ -41,7 +41,7 @@ const (
 	// FieldStopTime holds the string denoting the stop_time field in the database.
 	FieldStopTime = "stop_time"
 	// Table holds the table name of the batchmsg in the database.
-	Table = "batch_msgs"
+	Table = "batch_msg"
 )
 
 // Columns holds all SQL columns for batchmsg fields.

+ 11 - 11
ent/migrate/schema.go

@@ -9,8 +9,8 @@ import (
 )
 
 var (
-	// BatchMsgsColumns holds the columns for the "batch_msgs" table.
-	BatchMsgsColumns = []*schema.Column{
+	// BatchMsgColumns holds the columns for the "batch_msg" table.
+	BatchMsgColumns = []*schema.Column{
 		{Name: "id", Type: field.TypeUint64, Increment: true},
 		{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
 		{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
@@ -26,16 +26,16 @@ var (
 		{Name: "start_time", Type: field.TypeTime, Nullable: true, Comment: "开始时间"},
 		{Name: "stop_time", Type: field.TypeTime, Nullable: true, Comment: "结束时间"},
 	}
-	// BatchMsgsTable holds the schema information for the "batch_msgs" table.
-	BatchMsgsTable = &schema.Table{
-		Name:       "batch_msgs",
-		Columns:    BatchMsgsColumns,
-		PrimaryKey: []*schema.Column{BatchMsgsColumns[0]},
+	// BatchMsgTable holds the schema information for the "batch_msg" table.
+	BatchMsgTable = &schema.Table{
+		Name:       "batch_msg",
+		Columns:    BatchMsgColumns,
+		PrimaryKey: []*schema.Column{BatchMsgColumns[0]},
 		Indexes: []*schema.Index{
 			{
 				Name:    "batchmsg_batch_no",
 				Unique:  true,
-				Columns: []*schema.Column{BatchMsgsColumns[5]},
+				Columns: []*schema.Column{BatchMsgColumns[5]},
 			},
 		},
 	}
@@ -420,7 +420,7 @@ var (
 	}
 	// Tables holds all the tables in the schema.
 	Tables = []*schema.Table{
-		BatchMsgsTable,
+		BatchMsgTable,
 		ContactsTable,
 		LabelsTable,
 		LabelRelationshipsTable,
@@ -435,8 +435,8 @@ var (
 )
 
 func init() {
-	BatchMsgsTable.Annotation = &entsql.Annotation{
-		Table: "batch_msgs",
+	BatchMsgTable.Annotation = &entsql.Annotation{
+		Table: "batch_msg",
 	}
 	ContactsTable.Annotation = &entsql.Annotation{
 		Table: "contacts",