feat: 更新用户、订单、媒体资产和租户模型,添加新的字段类型和结构体
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"quyun/v2/database/fields"
|
||||
"quyun/v2/pkg/consts"
|
||||
|
||||
"go.ipao.vip/gen"
|
||||
@@ -18,16 +19,16 @@ const TableNameTenant = "tenants"
|
||||
|
||||
// Tenant mapped from table <tenants>
|
||||
type Tenant struct {
|
||||
ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
|
||||
UserID int64 `gorm:"column:user_id;type:bigint;not null" json:"user_id"`
|
||||
Code string `gorm:"column:code;type:character varying(64);not null" json:"code"`
|
||||
UUID types.UUID `gorm:"column:uuid;type:uuid;not null" json:"uuid"`
|
||||
Name string `gorm:"column:name;type:character varying(128);not null" json:"name"`
|
||||
Status consts.TenantStatus `gorm:"column:status;type:character varying(64);not null" json:"status"`
|
||||
Config types.JSON `gorm:"column:config;type:jsonb;default:{}" json:"config"`
|
||||
ExpiredAt time.Time `gorm:"column:expired_at;type:timestamp with time zone" json:"expired_at"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:timestamp with time zone;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp with time zone;default:now()" json:"updated_at"`
|
||||
ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
|
||||
UserID int64 `gorm:"column:user_id;type:bigint;not null" json:"user_id"`
|
||||
Code string `gorm:"column:code;type:character varying(64);not null" json:"code"`
|
||||
UUID types.UUID `gorm:"column:uuid;type:uuid;not null" json:"uuid"`
|
||||
Name string `gorm:"column:name;type:character varying(128);not null" json:"name"`
|
||||
Status consts.TenantStatus `gorm:"column:status;type:character varying(64);not null" json:"status"`
|
||||
Config types.JSONType[fields.TenantConfig] `gorm:"column:config;type:jsonb;default:{}" json:"config"`
|
||||
ExpiredAt time.Time `gorm:"column:expired_at;type:timestamp with time zone" json:"expired_at"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:timestamp with time zone;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp with time zone;default:now()" json:"updated_at"`
|
||||
}
|
||||
|
||||
// Quick operations without importing query package
|
||||
|
||||
Reference in New Issue
Block a user