initial commit: base structure, config, models

This commit is contained in:
fanir 2022-01-23 02:19:32 +01:00
commit c81d7c3264
13 changed files with 1992 additions and 0 deletions
models

View file

@ -0,0 +1,8 @@
package migrations
import (
"embed"
)
//go:embed *.sql
var FS embed.FS

55
models/models.go Normal file
View file

@ -0,0 +1,55 @@
package models
import (
"net"
"time"
"github.com/google/uuid"
)
type Feed struct {
ID uuid.UUID // PRIMARY KEY
Slug string // NOT NULL UNIQUE
URI string // NOT NULL
AutoRefresh bool // NOT NULL
RefreshInterval int //
NextRefresh time.Time // NOT NULL
Expire bool // NOT NULL
ExpireDate time.Time //
Password string //
CreationIP net.IP // NOT NULL
CreationDate time.Time // NOT NULL DEFAULT now()
}
type Feeditem struct {
Feed int // NOT NULL REFERENCES feed ON DELETE CASCADE ON UPDATE CASCADE
Timestamp time.Time // NOT NULL DEFAULT now()
HTML string // NOT NULL
Diff string //
//PRIMARY KEY (feed_ time.Time //)
}
type Announcement struct {
ID uuid.UUID // PRIMARY KEY
Title string // NOT NULL
Content string // NOT NULL
Abstract string //
PublicationDate time.Time // NOT NULL DEFAULT now()
ShowUntil time.Time //
IsImportant bool // NOT NULL
}
type Feedhistory struct {
Feed int // NOT NULL REFERENCES feed ON DELETE CASCADE ON UPDATE CASCADE
Timestamp time.Time // NOT NULL DEFAULT now()
IP net.IP // NOT NULL
Slug string //
URI string //
AutoRefresh bool //
RefreshInterval int //
NextRefresh time.Time //
Expire bool // NOT NULL
ExpireDate time.Time //
Password string //
//PRIMARY KEY (feed_ time.Time //)
}