snapshot of https://github.com/traggo/server.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
build / build (push) Failing after 3s
Some checks failed
build / build (push) Failing after 3s
This commit is contained in:
23
model/timespan.go
Normal file
23
model/timespan.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// TimeSpan is basically a tagged time range.
|
||||
type TimeSpan struct {
|
||||
ID int `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
|
||||
StartUTC time.Time
|
||||
EndUTC *time.Time
|
||||
StartUserTime time.Time
|
||||
EndUserTime *time.Time
|
||||
OffsetUTC int
|
||||
UserID int `gorm:"type:int REFERENCES users(id) ON DELETE CASCADE"`
|
||||
Tags []TimeSpanTag
|
||||
Note string
|
||||
}
|
||||
|
||||
// TimeSpanTag is a tag for a time range
|
||||
type TimeSpanTag struct {
|
||||
TimeSpanID int `gorm:"type:int REFERENCES time_spans(id) ON DELETE CASCADE"`
|
||||
Key string
|
||||
StringValue string
|
||||
}
|
||||
Reference in New Issue
Block a user