From acd0be8fa18e8ccba6ecb13cf3151601a18c01fb Mon Sep 17 00:00:00 2001 From: lethdat Date: Thu, 22 Jan 2026 17:03:07 +0700 Subject: [PATCH] update automic --- internal/database/model/payment.gen.go | 21 ++++++++------- internal/database/model/plan.gen.go | 23 ++++++++-------- internal/database/model/user.gen.go | 23 ++++++++-------- internal/database/model/video.gen.go | 37 +++++++++++++------------- internal/database/query/payment.gen.go | 6 ++++- internal/database/query/plan.gen.go | 6 ++++- internal/database/query/user.gen.go | 6 ++++- internal/database/query/video.gen.go | 6 ++++- 8 files changed, 74 insertions(+), 54 deletions(-) diff --git a/internal/database/model/payment.gen.go b/internal/database/model/payment.gen.go index 58b78c0..b02ba65 100644 --- a/internal/database/model/payment.gen.go +++ b/internal/database/model/payment.gen.go @@ -12,16 +12,17 @@ const TableNamePayment = "payment" // Payment mapped from table type Payment struct { - ID string `gorm:"column:id;primaryKey;default:gen_random_uuid()" json:"id"` - UserID string `gorm:"column:user_id;not null" json:"user_id"` - PlanID string `gorm:"column:plan_id" json:"plan_id"` - Amount float64 `gorm:"column:amount;not null" json:"amount"` - Currency string `gorm:"column:currency;not null;default:USD" json:"currency"` - Status string `gorm:"column:status;not null;default:PENDING" json:"status"` - Provider string `gorm:"column:provider;not null;default:STRIPE" json:"provider"` - TransactionID string `gorm:"column:transaction_id" json:"transaction_id"` - CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"` - UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"` + ID string `gorm:"column:id;type:uuid;primaryKey;default:gen_random_uuid()" json:"id"` + UserID string `gorm:"column:user_id;type:uuid;not null" json:"user_id"` + PlanID *string `gorm:"column:plan_id;type:uuid" json:"plan_id"` + Amount float64 `gorm:"column:amount;type:numeric(65,30);not null" json:"amount"` + Currency *string `gorm:"column:currency;type:text;not null;default:USD" json:"currency"` + Status *string `gorm:"column:status;type:character varying(20);not null;default:PENDING" json:"status"` + Provider *string `gorm:"column:provider;type:character varying(20);not null;default:STRIPE" json:"provider"` + TransactionID *string `gorm:"column:transaction_id;type:text" json:"transaction_id"` + CreatedAt *time.Time `gorm:"column:created_at;type:timestamp(3) without time zone;not null;default:CURRENT_TIMESTAMP" json:"created_at"` + UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp(3) without time zone;not null" json:"updated_at"` + Version *int64 `gorm:"column:version;type:bigint;not null;default:1;version" json:"-"` } // TableName Payment's table name diff --git a/internal/database/model/plan.gen.go b/internal/database/model/plan.gen.go index 6e6cdc6..56f6fb7 100644 --- a/internal/database/model/plan.gen.go +++ b/internal/database/model/plan.gen.go @@ -8,17 +8,18 @@ const TableNamePlan = "plan" // Plan mapped from table type Plan struct { - ID string `gorm:"column:id;primaryKey;default:gen_random_uuid()" json:"id"` - Name string `gorm:"column:name;not null" json:"name"` - Description string `gorm:"column:description" json:"description"` - Price float64 `gorm:"column:price;not null" json:"price"` - Cycle string `gorm:"column:cycle;not null" json:"cycle"` - StorageLimit int64 `gorm:"column:storage_limit;not null" json:"storage_limit"` - UploadLimit int32 `gorm:"column:upload_limit;not null" json:"upload_limit"` - DurationLimit int32 `gorm:"column:duration_limit;not null" json:"duration_limit"` - QualityLimit string `gorm:"column:quality_limit;not null" json:"quality_limit"` - Features string `gorm:"column:features" json:"features"` - IsActive bool `gorm:"column:is_active;not null;default:true" json:"is_active"` + ID string `gorm:"column:id;type:uuid;primaryKey;default:gen_random_uuid()" json:"id"` + Name string `gorm:"column:name;type:text;not null" json:"name"` + Description *string `gorm:"column:description;type:text" json:"description"` + Price float64 `gorm:"column:price;type:numeric(65,30);not null" json:"price"` + Cycle string `gorm:"column:cycle;type:character varying(20);not null" json:"cycle"` + StorageLimit int64 `gorm:"column:storage_limit;type:bigint;not null" json:"storage_limit"` + UploadLimit int32 `gorm:"column:upload_limit;type:integer;not null" json:"upload_limit"` + DurationLimit int32 `gorm:"column:duration_limit;type:integer;not null" json:"duration_limit"` + QualityLimit string `gorm:"column:quality_limit;type:text;not null" json:"quality_limit"` + Features *string `gorm:"column:features;type:text[]" json:"features"` + IsActive *bool `gorm:"column:is_active;type:boolean;not null;default:true" json:"is_active"` + Version *int64 `gorm:"column:version;type:bigint;not null;default:1;version" json:"-"` } // TableName Plan's table name diff --git a/internal/database/model/user.gen.go b/internal/database/model/user.gen.go index f4af369..7637603 100644 --- a/internal/database/model/user.gen.go +++ b/internal/database/model/user.gen.go @@ -12,17 +12,18 @@ const TableNameUser = "user" // User mapped from table type User struct { - ID string `gorm:"column:id;primaryKey;default:gen_random_uuid()" json:"id"` - Email string `gorm:"column:email;not null" json:"email"` - Password string `gorm:"column:password" json:"-"` - Username string `gorm:"column:username" json:"username"` - Avatar string `gorm:"column:avatar" json:"avatar"` - Role string `gorm:"column:role;not null;default:USER" json:"role"` - GoogleID string `gorm:"column:google_id" json:"google_id"` - StorageUsed int64 `gorm:"column:storage_used;not null" json:"storage_used"` - PlanID string `gorm:"column:plan_id" json:"plan_id"` - CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"` - UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"` + ID string `gorm:"column:id;type:uuid;primaryKey;default:gen_random_uuid()" json:"id"` + Email string `gorm:"column:email;type:text;not null;uniqueIndex:user_email_key,priority:1" json:"email"` + Password *string `gorm:"column:password;type:text" json:"-"` + Username *string `gorm:"column:username;type:text" json:"username"` + Avatar *string `gorm:"column:avatar;type:text" json:"avatar"` + Role *string `gorm:"column:role;type:character varying(20);not null;default:USER" json:"role"` + GoogleID *string `gorm:"column:google_id;type:text;uniqueIndex:user_google_id_key,priority:1" json:"google_id"` + StorageUsed int64 `gorm:"column:storage_used;type:bigint;not null" json:"storage_used"` + PlanID *string `gorm:"column:plan_id;type:uuid" json:"plan_id"` + CreatedAt *time.Time `gorm:"column:created_at;type:timestamp(3) without time zone;not null;default:CURRENT_TIMESTAMP" json:"created_at"` + UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp(3) without time zone;not null" json:"updated_at"` + Version *int64 `gorm:"column:version;type:bigint;not null;default:1;version" json:"-"` } // TableName User's table name diff --git a/internal/database/model/video.gen.go b/internal/database/model/video.gen.go index a3b9f41..542e7ec 100644 --- a/internal/database/model/video.gen.go +++ b/internal/database/model/video.gen.go @@ -12,24 +12,25 @@ const TableNameVideo = "video" // Video mapped from table