You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

v91.go 592B

1234567891011121314151617181920212223242526
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package migrations
  5. import "xorm.io/xorm"
  6. func addIndexOnRepositoryAndComment(x *xorm.Engine) error {
  7. type Repository struct {
  8. ID int64 `xorm:"pk autoincr"`
  9. OwnerID int64 `xorm:"index"`
  10. }
  11. if err := x.Sync2(new(Repository)); err != nil {
  12. return err
  13. }
  14. type Comment struct {
  15. ID int64 `xorm:"pk autoincr"`
  16. Type int `xorm:"index"`
  17. ReviewID int64 `xorm:"index"`
  18. }
  19. return x.Sync2(new(Comment))
  20. }