Files
junhong_cmp_fiber/internal/model/log_archive_run.go
break 88cc5e96ec
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m32s
暂存
2026-08-06 09:35:00 +08:00

39 lines
2.8 KiB
Go

package model
import "time"
// LogArchiveRun 是日志冷归档运行账本,不保存日志正文。
type LogArchiveRun struct {
ID uint `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Source string `gorm:"column:source;type:varchar(32);not null" json:"source"`
ArchiveDate time.Time `gorm:"column:archive_date;type:date;not null" json:"archive_date"`
InstanceID string `gorm:"column:instance_id;type:varchar(100);not null" json:"instance_id"`
SchemaVersion string `gorm:"column:schema_version;type:varchar(32);not null" json:"schema_version"`
Revision int `gorm:"column:revision;not null;default:1" json:"revision"`
Status string `gorm:"column:status;type:varchar(16);not null" json:"status"`
IsFinal bool `gorm:"column:is_final;not null;default:false" json:"is_final"`
RangeStart time.Time `gorm:"column:range_start;type:timestamptz;not null" json:"range_start"`
RangeEnd time.Time `gorm:"column:range_end;type:timestamptz;not null" json:"range_end"`
ObjectKey string `gorm:"column:object_key;type:varchar(500);not null;default:''" json:"object_key"`
ManifestKey string `gorm:"column:manifest_key;type:varchar(500);not null;default:''" json:"manifest_key"`
EventCount int64 `gorm:"column:event_count;not null;default:0" json:"event_count"`
ResourceCount int64 `gorm:"column:resource_count;not null;default:0" json:"resource_count"`
RecordCount int64 `gorm:"column:record_count;not null;default:0" json:"record_count"`
UncompressedBytes int64 `gorm:"column:uncompressed_bytes;not null;default:0" json:"uncompressed_bytes"`
CompressedBytes int64 `gorm:"column:compressed_bytes;not null;default:0" json:"compressed_bytes"`
SHA256 string `gorm:"column:sha256;type:varchar(64);not null;default:''" json:"sha256"`
AttemptCount int `gorm:"column:attempt_count;not null;default:0" json:"attempt_count"`
ErrorSummary string `gorm:"column:error_summary;type:varchar(500);not null;default:''" json:"error_summary"`
GeneratedAt *time.Time `gorm:"column:generated_at" json:"generated_at,omitempty"`
CompletedAt *time.Time `gorm:"column:completed_at" json:"completed_at,omitempty"`
CleanupStartedAt *time.Time `gorm:"column:cleanup_started_at" json:"cleanup_started_at,omitempty"`
CleanedAt *time.Time `gorm:"column:cleaned_at" json:"cleaned_at,omitempty"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updated_at"`
}
// TableName 返回日志冷归档运行账本表名。
func (LogArchiveRun) TableName() string {
return "tb_log_archive_run"
}