fix: add new fields on subscribe plan, and change status type to number in subscribe

This commit is contained in:
ericprd
2025-03-10 11:48:20 +08:00
parent 52dfb7e0f2
commit ce341dbc13
8 changed files with 39 additions and 11 deletions
+4 -1
View File
@@ -9,7 +9,7 @@ type Subscribe struct {
SubscribePlanID string `gorm:"not null" json:"subscribe_plan_id"`
StartDate time.Time `gorm:"default:CURRENT_TIMESTAMP"`
EndDate time.Time `gorm:"default:null"`
Status string `gorm:"default:'inactive'"`
Status int8 `gorm:"default:0"`
AutoRenew bool `gorm:"default:true"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
@@ -22,6 +22,9 @@ type SubscribePlan struct {
ID string `gorm:"primaryKey" json:"id"`
Code string `gorm:"not null;unique" json:"code"`
Name string `gorm:"not null" json:"name"`
Length int `gorm:"default:0" json:"length"`
Price float32 `gorm:"default:0" json:"price"`
Status int8 `gorm:"default:1" json:"status"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}