show last time item was refreshed
This commit is contained in:
@@ -28,11 +28,12 @@ type Torrent struct {
|
||||
}
|
||||
|
||||
type Item struct {
|
||||
ID int64 `json:"id" db:"id"`
|
||||
Query string `json:"query" db:"query"`
|
||||
Category int `json:"category" db:"category"`
|
||||
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
||||
Torrents []Torrent `json:"torrents,omitempty"`
|
||||
ID int64 `json:"id" db:"id"`
|
||||
Query string `json:"query" db:"query"`
|
||||
Category int `json:"category" db:"category"`
|
||||
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
||||
Torrents []Torrent `json:"torrents,omitempty"`
|
||||
RefreshedAt *time.Time `json:"refreshedAt" db:"refreshed_at"`
|
||||
}
|
||||
|
||||
func (m *Model) Init() {
|
||||
@@ -59,6 +60,8 @@ func (m *Model) Init() {
|
||||
item_id integer not null,
|
||||
FOREIGN KEY (item_id) REFERENCES users(id)
|
||||
)`)
|
||||
|
||||
m.db.Exec(`ALTER TABLE items ADD COLUMN refreshed_at datetime default null`)
|
||||
}
|
||||
|
||||
func New(db *sqlx.DB) *Model {
|
||||
|
||||
Reference in New Issue
Block a user