@@ -35,9 +35,39 @@ func (*improveNotificationTableIndicesAction) TableName() string {
35
35
36
36
// TableIndices implements xorm's TableIndices interface
37
37
func (* improveNotificationTableIndicesAction ) TableIndices () []* schemas.Index {
38
+ indices := make ([]* schemas.Index , 0 , 8 )
38
39
usuuIndex := schemas .NewIndex ("u_s_uu" , schemas .IndexType )
39
40
usuuIndex .AddColumn ("user_id" , "status" , "updated_unix" )
40
- indices := []* schemas.Index {usuuIndex }
41
+ indices = append (indices , usuuIndex )
42
+
43
+ // Add the individual indices that were previously defined in struct tags
44
+ userIDIndex := schemas .NewIndex ("idx_notification_user_id" , schemas .IndexType )
45
+ userIDIndex .AddColumn ("user_id" )
46
+ indices = append (indices , userIDIndex )
47
+
48
+ repoIDIndex := schemas .NewIndex ("idx_notification_repo_id" , schemas .IndexType )
49
+ repoIDIndex .AddColumn ("repo_id" )
50
+ indices = append (indices , repoIDIndex )
51
+
52
+ statusIndex := schemas .NewIndex ("idx_notification_status" , schemas .IndexType )
53
+ statusIndex .AddColumn ("status" )
54
+ indices = append (indices , statusIndex )
55
+
56
+ sourceIndex := schemas .NewIndex ("idx_notification_source" , schemas .IndexType )
57
+ sourceIndex .AddColumn ("source" )
58
+ indices = append (indices , sourceIndex )
59
+
60
+ issueIDIndex := schemas .NewIndex ("idx_notification_issue_id" , schemas .IndexType )
61
+ issueIDIndex .AddColumn ("issue_id" )
62
+ indices = append (indices , issueIDIndex )
63
+
64
+ commitIDIndex := schemas .NewIndex ("idx_notification_commit_id" , schemas .IndexType )
65
+ commitIDIndex .AddColumn ("commit_id" )
66
+ indices = append (indices , commitIDIndex )
67
+
68
+ updatedByIndex := schemas .NewIndex ("idx_notification_updated_by" , schemas .IndexType )
69
+ updatedByIndex .AddColumn ("updated_by" )
70
+ indices = append (indices , updatedByIndex )
41
71
42
72
return indices
43
73
}
0 commit comments