2024-02-15 17:10:39 +01:00
|
|
|
package pds
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
2024-02-15 21:29:08 +01:00
|
|
|
|
|
|
|
"github.com/uabluerail/indexer/models"
|
2024-02-15 17:10:39 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type PDS struct {
|
2024-02-15 21:29:08 +01:00
|
|
|
ID models.ID `gorm:"primarykey"`
|
|
|
|
CreatedAt time.Time
|
|
|
|
UpdatedAt time.Time
|
2024-02-15 17:10:39 +01:00
|
|
|
Host string `gorm:"uniqueIndex"`
|
|
|
|
Cursor int64
|
|
|
|
FirstCursorSinceReset int64
|
|
|
|
LastList time.Time
|
|
|
|
CrawlLimit int
|
|
|
|
}
|
|
|
|
|
|
|
|
func AutoMigrate(db *gorm.DB) error {
|
|
|
|
return db.AutoMigrate(&PDS{})
|
|
|
|
}
|