gitea源码

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