This commit is contained in:
jinnrry 2024-04-15 15:09:09 +08:00
parent ce393211cf
commit 6ecb61ac45
2 changed files with 15 additions and 0 deletions

View File

@ -23,4 +23,8 @@ func SyncTables() {
if err != nil {
panic(err)
}
err = db.Instance.Sync2(&Sessions{})
if err != nil {
panic(err)
}
}

11
server/models/session.go Normal file
View File

@ -0,0 +1,11 @@
package models
type Sessions struct {
Token string `xorm:"token char(43) not null pk " json:"token"`
Data string `xorm:"data blob" json:"data"`
Expiry int `xorm:"expiry timestamp index" json:"expiry"`
}
func (p *Sessions) TableName() string {
return "sessions"
}