summaryrefslogtreecommitdiffstats
path: root/models/migrations/v1_10/v91.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/migrations/v1_10/v91.go')
-rw-r--r--models/migrations/v1_10/v91.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/models/migrations/v1_10/v91.go b/models/migrations/v1_10/v91.go
new file mode 100644
index 0000000..48cac2d
--- /dev/null
+++ b/models/migrations/v1_10/v91.go
@@ -0,0 +1,25 @@
+// Copyright 2019 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package v1_10 //nolint
+
+import "xorm.io/xorm"
+
+func AddIndexOnRepositoryAndComment(x *xorm.Engine) error {
+ type Repository struct {
+ ID int64 `xorm:"pk autoincr"`
+ OwnerID int64 `xorm:"index"`
+ }
+
+ if err := x.Sync(new(Repository)); err != nil {
+ return err
+ }
+
+ type Comment struct {
+ ID int64 `xorm:"pk autoincr"`
+ Type int `xorm:"index"`
+ ReviewID int64 `xorm:"index"`
+ }
+
+ return x.Sync(new(Comment))
+}