123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- // Code generated by ent, DO NOT EDIT.
- package migrate
- import (
- "entgo.io/ent/dialect/entsql"
- "entgo.io/ent/dialect/sql/schema"
- "entgo.io/ent/schema/field"
- )
- var (
- // MessageRecordsColumns holds the columns for the "message_records" table.
- MessageRecordsColumns = []*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 | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
- {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
- {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
- {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
- {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
- {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
- {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
- {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
- {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
- {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
- {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
- }
- // MessageRecordsTable holds the schema information for the "message_records" table.
- MessageRecordsTable = &schema.Table{
- Name: "message_records",
- Columns: MessageRecordsColumns,
- PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
- }
- // SysTasksColumns holds the columns for the "sys_tasks" table.
- SysTasksColumns = []*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 | 修改日期"},
- {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
- {Name: "name", Type: field.TypeString},
- {Name: "task_group", Type: field.TypeString},
- {Name: "cron_expression", Type: field.TypeString},
- {Name: "pattern", Type: field.TypeString},
- {Name: "payload", Type: field.TypeString},
- }
- // SysTasksTable holds the schema information for the "sys_tasks" table.
- SysTasksTable = &schema.Table{
- Name: "sys_tasks",
- Columns: SysTasksColumns,
- PrimaryKey: []*schema.Column{SysTasksColumns[0]},
- Indexes: []*schema.Index{
- {
- Name: "task_pattern",
- Unique: true,
- Columns: []*schema.Column{SysTasksColumns[7]},
- },
- },
- }
- // SysTaskLogsColumns holds the columns for the "sys_task_logs" table.
- SysTaskLogsColumns = []*schema.Column{
- {Name: "id", Type: field.TypeUint64, Increment: true},
- {Name: "started_at", Type: field.TypeTime, Comment: "Task Started Time | 任务启动时间"},
- {Name: "finished_at", Type: field.TypeTime, Comment: "Task Finished Time | 任务完成时间"},
- {Name: "result", Type: field.TypeUint8, Comment: "The Task Process Result | 任务执行结果"},
- {Name: "task_task_logs", Type: field.TypeUint64, Nullable: true},
- }
- // SysTaskLogsTable holds the schema information for the "sys_task_logs" table.
- SysTaskLogsTable = &schema.Table{
- Name: "sys_task_logs",
- Columns: SysTaskLogsColumns,
- PrimaryKey: []*schema.Column{SysTaskLogsColumns[0]},
- ForeignKeys: []*schema.ForeignKey{
- {
- Symbol: "sys_task_logs_sys_tasks_task_logs",
- Columns: []*schema.Column{SysTaskLogsColumns[4]},
- RefColumns: []*schema.Column{SysTasksColumns[0]},
- OnDelete: schema.SetNull,
- },
- },
- }
- // Tables holds all the tables in the schema.
- Tables = []*schema.Table{
- MessageRecordsTable,
- SysTasksTable,
- SysTaskLogsTable,
- }
- )
- func init() {
- MessageRecordsTable.Annotation = &entsql.Annotation{
- Table: "message_records",
- }
- SysTasksTable.Annotation = &entsql.Annotation{
- Table: "sys_tasks",
- }
- SysTaskLogsTable.ForeignKeys[0].RefTable = SysTasksTable
- SysTaskLogsTable.Annotation = &entsql.Annotation{
- Table: "sys_task_logs",
- }
- }
|