 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
    var ( // WithGlobalUniqueID sets the universal ids options to the migration. // If this option is enabled, ent migration will allocate a 1<<32 range // for the ids of each entity (table). // Note that this option cannot be applied on tables that already exist. WithGlobalUniqueID = schema.WithGlobalUniqueID // WithDropColumn sets the drop column option to the migration. // If this option is enabled, ent migration will drop old columns // that were used for both fields and edges. This defaults to false. WithDropColumn = schema.WithDropColumn // WithDropIndex sets the drop index option to the migration. // If this option is enabled, ent migration will drop old indexes // that were defined in the schema. This defaults to false. // Note that unique constraints are defined using `UNIQUE INDEX`, // and therefore, it's recommended to enable this option to get more // flexibility in the schema changes. WithDropIndex = schema.WithDropIndex // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true. WithForeignKeys = schema.WithForeignKeys )
      View Source
      
  
var ( // PayAppColumns holds the columns for the "pay_app" table. PayAppColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "name", Type: field.TypeString, Comment: "应用名"}, {Name: "remark", Type: field.TypeString, Nullable: true, Comment: "应用名"}, {Name: "order_notify_url", Type: field.TypeString, Comment: "支付结果的回调地址"}, {Name: "refund_notify_url", Type: field.TypeString, Comment: "退款结果的回调地址"}, } // PayAppTable holds the schema information for the "pay_app" table. PayAppTable = &schema.Table{ Name: "pay_app", Columns: PayAppColumns, PrimaryKey: []*schema.Column{PayAppColumns[0]}, } // PayChannelColumns holds the columns for the "pay_channel" table. PayChannelColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "code", Type: field.TypeString, Comment: "渠道编码"}, {Name: "remark", Type: field.TypeString, Nullable: true, Comment: "应用名"}, {Name: "fee_rate", Type: field.TypeFloat64, Comment: "渠道费率,单位:百分比"}, {Name: "app_id", Type: field.TypeUint64, Comment: "应用编号"}, {Name: "config", Type: field.TypeString, Size: 2147483647, Comment: "支付渠道配置"}, } // PayChannelTable holds the schema information for the "pay_channel" table. PayChannelTable = &schema.Table{ Name: "pay_channel", Columns: PayChannelColumns, PrimaryKey: []*schema.Column{PayChannelColumns[0]}, } // PayDemoOrderColumns holds the columns for the "pay_demo_order" table. PayDemoOrderColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "user_id", Type: field.TypeString, Comment: "用户编号"}, {Name: "spu_id", Type: field.TypeUint64, Comment: "商品编号"}, {Name: "spu_name", Type: field.TypeString, Comment: "商品名称"}, {Name: "price", Type: field.TypeInt32, Comment: "价格,单位:分"}, {Name: "pay_status", Type: field.TypeBool, Comment: "是否支付"}, {Name: "pay_order_id", Type: field.TypeUint64, Nullable: true, Comment: "支付订单编号"}, {Name: "pay_time", Type: field.TypeTime, Nullable: true, Comment: "付款时间"}, {Name: "pay_channel_code", Type: field.TypeString, Nullable: true, Comment: "支付渠道"}, {Name: "pay_refund_id", Type: field.TypeUint64, Nullable: true, Comment: "支付退款单号"}, {Name: "refund_price", Type: field.TypeInt32, Nullable: true, Comment: "退款金额,单位:分"}, {Name: "refund_time", Type: field.TypeTime, Nullable: true, Comment: "退款完成时间"}, } // PayDemoOrderTable holds the schema information for the "pay_demo_order" table. PayDemoOrderTable = &schema.Table{ Name: "pay_demo_order", Columns: PayDemoOrderColumns, PrimaryKey: []*schema.Column{PayDemoOrderColumns[0]}, } // PayNotifyLogColumns holds the columns for the "pay_notify_log" table. PayNotifyLogColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "task_id", Type: field.TypeUint64, Comment: "通知任务编号"}, {Name: "notify_times", Type: field.TypeInt8, Comment: "第几次被通知"}, {Name: "response", Type: field.TypeString, Size: 2147483647, Comment: "请求参数"}, } // PayNotifyLogTable holds the schema information for the "pay_notify_log" table. PayNotifyLogTable = &schema.Table{ Name: "pay_notify_log", Columns: PayNotifyLogColumns, PrimaryKey: []*schema.Column{PayNotifyLogColumns[0]}, } // PayNotifyTaskColumns holds the columns for the "pay_notify_task" table. PayNotifyTaskColumns = []*schema.Column{ {Name: "id", Type: field.TypeUint64, Increment: true, Comment: "任务编号"}, {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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "app_id", Type: field.TypeUint64, Comment: "应用编号"}, {Name: "type", Type: field.TypeInt, Comment: "通知类型"}, {Name: "data_id", Type: field.TypeUint64, Comment: "数据编号"}, {Name: "merchant_order_id", Type: field.TypeString, Comment: "商户订单编号"}, {Name: "next_notify_time", Type: field.TypeTime, Comment: "下一次通知时间"}, {Name: "last_execute_time", Type: field.TypeTime, Comment: "最后一次执行时间"}, {Name: "notify_times", Type: field.TypeInt8, Comment: "当前通知次数"}, {Name: "max_notify_times", Type: field.TypeInt8, Comment: "最大可通知次数"}, {Name: "notify_url", Type: field.TypeString, Comment: "异步通知地址"}, } // PayNotifyTaskTable holds the schema information for the "pay_notify_task" table. PayNotifyTaskTable = &schema.Table{ Name: "pay_notify_task", Columns: PayNotifyTaskColumns, PrimaryKey: []*schema.Column{PayNotifyTaskColumns[0]}, } // PayOrderColumns holds the columns for the "pay_order" table. PayOrderColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "app_id", Type: field.TypeUint64, Comment: "应用编号"}, {Name: "channel_id", Type: field.TypeUint64, Nullable: true, Comment: "渠道编号"}, {Name: "channel_code", Type: field.TypeString, Nullable: true, Comment: "渠道编码"}, {Name: "merchant_order_id", Type: field.TypeString, Comment: "商户订单编号"}, {Name: "subject", Type: field.TypeString, Comment: "商品标题"}, {Name: "body", Type: field.TypeString, Comment: "商品描述"}, {Name: "notify_url", Type: field.TypeString, Size: 2147483647, Comment: "异步通知地址"}, {Name: "price", Type: field.TypeInt32, Comment: "支付金额,单位:分"}, {Name: "channel_fee_rate", Type: field.TypeFloat64, Nullable: true, Comment: "渠道手续费,单位:百分比"}, {Name: "channel_fee_price", Type: field.TypeInt32, Nullable: true, Comment: "渠道手续金额,单位:分"}, {Name: "user_ip", Type: field.TypeString, Comment: "用户 IP"}, {Name: "expire_time", Type: field.TypeTime, Comment: "订单失效时间"}, {Name: "success_time", Type: field.TypeTime, Nullable: true, Comment: "订单支付成功时间"}, {Name: "notify_time", Type: field.TypeTime, Nullable: true, Comment: "订单支付通知时间"}, {Name: "extension_id", Type: field.TypeUint64, Nullable: true, Comment: "支付成功的订单拓展单编号"}, {Name: "no", Type: field.TypeString, Nullable: true, Comment: "订单号"}, {Name: "refund_price", Type: field.TypeInt32, Comment: "退款总金额,单位:分"}, {Name: "channel_user_id", Type: field.TypeString, Nullable: true, Comment: "渠道用户编号"}, {Name: "channel_order_no", Type: field.TypeString, Nullable: true, Comment: "渠道订单号"}, } // PayOrderTable holds the schema information for the "pay_order" table. PayOrderTable = &schema.Table{ Name: "pay_order", Columns: PayOrderColumns, PrimaryKey: []*schema.Column{PayOrderColumns[0]}, } // PayOrderExtensionColumns holds the columns for the "pay_order_extension" table. PayOrderExtensionColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "no", Type: field.TypeString, Comment: "支付订单号"}, {Name: "order_id", Type: field.TypeUint64, Comment: "渠道编号"}, {Name: "channel_id", Type: field.TypeUint64, Comment: "渠道编号"}, {Name: "channel_code", Type: field.TypeString, Comment: "渠道编码"}, {Name: "user_ip", Type: field.TypeString, Comment: "用户 IP"}, {Name: "channel_extras", Type: field.TypeJSON, Nullable: true, Comment: "支付渠道的额外参数"}, {Name: "channel_error_code", Type: field.TypeString, Nullable: true, Comment: "调用渠道的错误码"}, {Name: "channel_error_msg", Type: field.TypeString, Nullable: true, Comment: "调用渠道报错时,错误信息"}, {Name: "channel_notify_data", Type: field.TypeString, Nullable: true, Size: 2147483647, Comment: "支付渠道异步通知的内容"}, } // PayOrderExtensionTable holds the schema information for the "pay_order_extension" table. PayOrderExtensionTable = &schema.Table{ Name: "pay_order_extension", Columns: PayOrderExtensionColumns, PrimaryKey: []*schema.Column{PayOrderExtensionColumns[0]}, } // PayRefundColumns holds the columns for the "pay_refund" table. PayRefundColumns = []*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: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"}, {Name: "no", Type: field.TypeString, Comment: "退款单号"}, {Name: "app_id", Type: field.TypeUint64, Comment: "应用编号"}, {Name: "channel_id", Type: field.TypeUint64, Comment: "渠道编号"}, {Name: "channel_code", Type: field.TypeString, Comment: "渠道编码"}, {Name: "order_id", Type: field.TypeUint64, Comment: "支付订单编号 pay_order 表id"}, {Name: "order_no", Type: field.TypeString, Comment: "支付订单 no"}, {Name: "merchant_order_id", Type: field.TypeString, Comment: "商户订单编号(商户系统生成)"}, {Name: "merchant_refund_id", Type: field.TypeString, Comment: "商户退款订单号(商户系统生成)"}, {Name: "notify_url", Type: field.TypeString, Comment: "异步通知商户地址"}, {Name: "pay_price", Type: field.TypeInt32, Comment: "支付金额,单位分"}, {Name: "refund_price", Type: field.TypeInt32, Comment: "退款金额,单位分"}, {Name: "reason", Type: field.TypeString, Comment: "退款原因"}, {Name: "user_ip", Type: field.TypeString, Nullable: true, Comment: "用户 IP"}, {Name: "channel_order_no", Type: field.TypeString, Comment: "渠道订单号,pay_order 中的 channel_order_no 对应"}, {Name: "channel_refund_no", Type: field.TypeString, Nullable: true, Comment: "渠道退款单号,渠道返回"}, {Name: "success_time", Type: field.TypeTime, Nullable: true, Comment: "退款成功时间"}, {Name: "channel_error_code", Type: field.TypeString, Nullable: true, Comment: "渠道调用报错时,错误码"}, {Name: "channel_error_msg", Type: field.TypeString, Nullable: true, Comment: "渠道调用报错时,错误信息"}, {Name: "channel_notify_data", Type: field.TypeString, Nullable: true, Comment: "支付渠道异步通知的内容"}, } // PayRefundTable holds the schema information for the "pay_refund" table. PayRefundTable = &schema.Table{ Name: "pay_refund", Columns: PayRefundColumns, PrimaryKey: []*schema.Column{PayRefundColumns[0]}, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ PayAppTable, PayChannelTable, PayDemoOrderTable, PayNotifyLogTable, PayNotifyTaskTable, PayOrderTable, PayOrderExtensionTable, PayRefundTable, } )
Functions ¶
Types ¶
type Schema ¶
type Schema struct {
	// contains filtered or unexported fields
}
    Schema is the API for creating, migrating and dropping a schema.
 Click to show internal directories. 
   Click to hide internal directories.