gitea源码

123456789101112131415161718192021
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_21
  4. import (
  5. "xorm.io/xorm"
  6. )
  7. func AddIndexToActionUserID(x *xorm.Engine) error {
  8. type Action struct {
  9. UserID int64 `xorm:"INDEX"`
  10. }
  11. _, err := x.SyncWithOptions(xorm.SyncOptions{
  12. IgnoreDropIndices: true,
  13. IgnoreConstrains: true,
  14. }, new(Action))
  15. return err
  16. }