23 lines
950 B
Go
23 lines
950 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type CampaignFiles struct {
|
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
|
CampaignID uint `json:"campaign_id" gorm:"type:int4"`
|
|
Campaign Campaigns `json:"campaign" gorm:"foreignKey:CampaignID;references:ID"`
|
|
Type string `json:"type" gorm:"type:varchar(20)"` // url, file
|
|
FileURL *string `json:"file_url" gorm:"type:text"`
|
|
ExternalURL *string `json:"external_url" gorm:"type:text"`
|
|
IsDraft *bool `json:"is_draft" gorm:"type:bool;default:false"`
|
|
IsPublish *bool `json:"is_publish" gorm:"type:bool;default:false"`
|
|
IsActive *bool `json:"is_active" gorm:"type:bool;default:true"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
|
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
|
|
}
|
|
|