22 lines
582 B
Go
22 lines
582 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
"gorm.io/gorm"
|
|
"lst.net/pkg"
|
|
)
|
|
|
|
type Log struct {
|
|
LogID uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4();primaryKey" json:"id"`
|
|
Level string `gorm:"size:10;not null"` // "info", "error", etc.
|
|
Message string `gorm:"not null"`
|
|
Service string `gorm:"size:50"`
|
|
Metadata pkg.JSONB `gorm:"type:jsonb"` // fields (e.g., {"user_id": 123})
|
|
CreatedAt time.Time `gorm:"index"`
|
|
Checked bool `gorm:"type:boolean;default:false"`
|
|
UpdatedAt time.Time
|
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
|
}
|