feedizer/models/models.go
fanir a7d08500f5 database and migrator revisions, help output, data model changes
- database:
  - moved to jackc/pgx from database/sql
  - revised migrator and moved it into it's own package
  - separated ParseConfig into it's own function
- config:
  - database config is now a DSN or URL instead of a struct
  - SearchPaths are now available through a function
- improved help / usage output
- modified data model
2022-02-22 00:08:19 +01:00

55 lines
1.5 KiB
Go

package models
import (
"net"
"time"
"github.com/google/uuid"
)
type Feed struct {
ID uuid.UUID // PRIMARY KEY
Title string // NOT NULL UNIQUE
URI string // 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 //)
}