schema.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // Code generated by ent, DO NOT EDIT.
  2. package migrate
  3. import (
  4. "entgo.io/ent/dialect/entsql"
  5. "entgo.io/ent/dialect/sql/schema"
  6. "entgo.io/ent/schema/field"
  7. )
  8. var (
  9. // MessageRecordsColumns holds the columns for the "message_records" table.
  10. MessageRecordsColumns = []*schema.Column{
  11. {Name: "id", Type: field.TypeUint64, Increment: true},
  12. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  13. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  14. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  15. {Name: "bot_wxid", Type: field.TypeString, Comment: "机器人微信 id"},
  16. {Name: "contact_id", Type: field.TypeUint64, Nullable: true, Comment: "联系人 id"},
  17. {Name: "contact_type", Type: field.TypeInt, Comment: "类型:1好友,2群组,3企业微信联系人", Default: 1},
  18. {Name: "contact_wxid", Type: field.TypeString, Comment: "接收方微信 id", Default: ""},
  19. {Name: "content_type", Type: field.TypeInt, Comment: "内容类型 1 文本 2 文件", Default: 1},
  20. {Name: "content", Type: field.TypeString, Comment: "发送内容", Default: ""},
  21. {Name: "error_detail", Type: field.TypeString, Comment: "异常原因", Default: ""},
  22. {Name: "send_time", Type: field.TypeTime, Nullable: true, Comment: "发送时间"},
  23. {Name: "source_type", Type: field.TypeInt, Comment: "源类型 1 点发 2 群发 3 SOP", Default: 1},
  24. {Name: "source_id", Type: field.TypeUint64, Nullable: true, Comment: "源 ID", Default: 1},
  25. {Name: "sub_source_id", Type: field.TypeUint64, Nullable: true, Comment: "次源 ID", Default: 1},
  26. }
  27. // MessageRecordsTable holds the schema information for the "message_records" table.
  28. MessageRecordsTable = &schema.Table{
  29. Name: "message_records",
  30. Columns: MessageRecordsColumns,
  31. PrimaryKey: []*schema.Column{MessageRecordsColumns[0]},
  32. }
  33. // SysTasksColumns holds the columns for the "sys_tasks" table.
  34. SysTasksColumns = []*schema.Column{
  35. {Name: "id", Type: field.TypeUint64, Increment: true},
  36. {Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
  37. {Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
  38. {Name: "status", Type: field.TypeUint8, Nullable: true, Comment: "Status 1: normal 2: ban | 状态 1 正常 2 禁用", Default: 1},
  39. {Name: "name", Type: field.TypeString},
  40. {Name: "task_group", Type: field.TypeString},
  41. {Name: "cron_expression", Type: field.TypeString},
  42. {Name: "pattern", Type: field.TypeString},
  43. {Name: "payload", Type: field.TypeString},
  44. }
  45. // SysTasksTable holds the schema information for the "sys_tasks" table.
  46. SysTasksTable = &schema.Table{
  47. Name: "sys_tasks",
  48. Columns: SysTasksColumns,
  49. PrimaryKey: []*schema.Column{SysTasksColumns[0]},
  50. Indexes: []*schema.Index{
  51. {
  52. Name: "task_pattern",
  53. Unique: true,
  54. Columns: []*schema.Column{SysTasksColumns[7]},
  55. },
  56. },
  57. }
  58. // SysTaskLogsColumns holds the columns for the "sys_task_logs" table.
  59. SysTaskLogsColumns = []*schema.Column{
  60. {Name: "id", Type: field.TypeUint64, Increment: true},
  61. {Name: "started_at", Type: field.TypeTime, Comment: "Task Started Time | 任务启动时间"},
  62. {Name: "finished_at", Type: field.TypeTime, Comment: "Task Finished Time | 任务完成时间"},
  63. {Name: "result", Type: field.TypeUint8, Comment: "The Task Process Result | 任务执行结果"},
  64. {Name: "task_task_logs", Type: field.TypeUint64, Nullable: true},
  65. }
  66. // SysTaskLogsTable holds the schema information for the "sys_task_logs" table.
  67. SysTaskLogsTable = &schema.Table{
  68. Name: "sys_task_logs",
  69. Columns: SysTaskLogsColumns,
  70. PrimaryKey: []*schema.Column{SysTaskLogsColumns[0]},
  71. ForeignKeys: []*schema.ForeignKey{
  72. {
  73. Symbol: "sys_task_logs_sys_tasks_task_logs",
  74. Columns: []*schema.Column{SysTaskLogsColumns[4]},
  75. RefColumns: []*schema.Column{SysTasksColumns[0]},
  76. OnDelete: schema.SetNull,
  77. },
  78. },
  79. }
  80. // Tables holds all the tables in the schema.
  81. Tables = []*schema.Table{
  82. MessageRecordsTable,
  83. SysTasksTable,
  84. SysTaskLogsTable,
  85. }
  86. )
  87. func init() {
  88. MessageRecordsTable.Annotation = &entsql.Annotation{
  89. Table: "message_records",
  90. }
  91. SysTasksTable.Annotation = &entsql.Annotation{
  92. Table: "sys_tasks",
  93. }
  94. SysTaskLogsTable.ForeignKeys[0].RefTable = SysTasksTable
  95. SysTaskLogsTable.Annotation = &entsql.Annotation{
  96. Table: "sys_task_logs",
  97. }
  98. }