Files
seadoc/models/version.go
Vladimir V Maksimov 72b757d196 remove sql scheme
2025-11-07 12:37:47 +03:00

25 lines
627 B
Go

package models
import (
"encoding/json"
"time"
"github.com/google/uuid"
)
// Version — конкретная версия документа
type Version struct {
ID uuid.UUID `gorm:"type:char(36);primaryKey"`
DocumentID uuid.UUID `gorm:"type:char(36);index"`
ParentID *uuid.UUID `gorm:"type:char(36);"`
IsSnapshot bool
Patch json.RawMessage `gorm:"type:json"` // JSON Patch или nil, если Snapshot
Snapshot json.RawMessage `gorm:"type:json"` // Полный JSON, если IsSnapshot = true
CreatedAt time.Time
}
func (s *Version) TableName() (res string) {
res = "version"
return
}