code.gitea.io/gitea@v1.22.3/models/migrations/v1_22/v281.go (about) 1 // Copyright 2023 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package v1_22 //nolint 5 6 import ( 7 "code.gitea.io/gitea/modules/timeutil" 8 9 "xorm.io/xorm" 10 ) 11 12 func CreateAuthTokenTable(x *xorm.Engine) error { 13 type AuthToken struct { 14 ID string `xorm:"pk"` 15 TokenHash string 16 UserID int64 `xorm:"INDEX"` 17 ExpiresUnix timeutil.TimeStamp `xorm:"INDEX"` 18 } 19 20 return x.Sync(new(AuthToken)) 21 }