This commit is contained in:
29
hn/db.go
Normal file
29
hn/db.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package hn
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
type HNStoryRank struct {
|
||||
gorm.Model
|
||||
InternalStoryID uint64 `gorm:"primary_key;auto_increment:true`
|
||||
HNID uint // HN integer id
|
||||
Title string // submission title
|
||||
URL string // duh
|
||||
FetchID uint // integer identifying fetch batch
|
||||
Rank uint // frontpage index
|
||||
FetchedAt time.Time // identical within fetchid
|
||||
}
|
||||
|
||||
type FrontPageCache struct {
|
||||
gorm.Model
|
||||
CacheID uint64 `gorm:"primary_key;auto_increment:true`
|
||||
HNID uint
|
||||
HighestRankReached uint
|
||||
URL string
|
||||
Title string
|
||||
Appeared time.Time
|
||||
Disappeared time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user