aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/v218.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/models/migrations/v218.go b/models/migrations/v218.go
index dee8e5517e..e08c6c5b0f 100644
--- a/models/migrations/v218.go
+++ b/models/migrations/v218.go
@@ -5,6 +5,7 @@
package migrations
import (
+ "code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
"xorm.io/xorm"
@@ -37,8 +38,14 @@ func (*improveActionTableIndicesAction) TableIndices() []*schemas.Index {
actUserIndex := schemas.NewIndex("au_r_c_u_d", schemas.IndexType)
actUserIndex.AddColumn("act_user_id", "repo_id", "created_unix", "user_id", "is_deleted")
-
- return []*schemas.Index{actUserIndex, repoIndex}
+ indices := []*schemas.Index{actUserIndex, repoIndex}
+ if setting.Database.UsePostgreSQL {
+ cudIndex := schemas.NewIndex("c_u_d", schemas.IndexType)
+ cudIndex.AddColumn("created_unix", "user_id", "is_deleted")
+ indices = append(indices, cudIndex)
+ }
+
+ return indices
}
func improveActionTableIndices(x *xorm.Engine) error {