Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e9bb6166
Commit
e9bb6166
authored
Nov 11, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix index definition
Add `id` to the index to support the tie breaker ordering.
parent
335222ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
db/migrate/20201110133629_change_index_mr_metrics_target_project_id.rb
...201110133629_change_index_mr_metrics_target_project_id.rb
+2
-2
db/structure.sql
db/structure.sql
+1
-1
No files found.
db/migrate/20201110133629_change_index_mr_metrics_target_project_id.rb
View file @
e9bb6166
...
...
@@ -9,12 +9,12 @@ class ChangeIndexMrMetricsTargetProjectId < ActiveRecord::Migration[6.0]
NULLS_LAST_INDEX_NAME
=
'index_mr_metrics_on_target_project_id_merged_at_nulls_last'
def
up
add_concurrent_index
:merge_request_metrics
,
[
:target_project_id
,
:merged_at
],
order:
{
merged_at:
'DESC NULLS LAST
'
},
name:
NULLS_LAST_INDEX_NAME
add_concurrent_index
:merge_request_metrics
,
[
:target_project_id
,
:merged_at
,
:id
],
order:
{
merged_at:
'DESC NULLS LAST'
,
id:
'DESC
'
},
name:
NULLS_LAST_INDEX_NAME
remove_concurrent_index_by_name
(
:merge_request_metrics
,
INDEX_NAME
)
end
def
down
add_concurrent_index
:merge_request_metrics
,
[
:target_project_id
,
:
created_at
,
:
merged_at
],
name:
INDEX_NAME
add_concurrent_index
:merge_request_metrics
,
[
:target_project_id
,
:merged_at
],
name:
INDEX_NAME
remove_concurrent_index_by_name
(
:merge_request_metrics
,
NULLS_LAST_INDEX_NAME
)
end
end
db/structure.sql
View file @
e9bb6166
...
...
@@ -21192,7 +21192,7 @@ CREATE UNIQUE INDEX index_mr_blocks_on_blocking_and_blocked_mr_ids ON merge_requ
CREATE
UNIQUE
INDEX
index_mr_context_commits_on_merge_request_id_and_sha
ON
merge_request_context_commits
USING
btree
(
merge_request_id
,
sha
);
CREATE
INDEX
index_mr_metrics_on_target_project_id_merged_at_nulls_last
ON
merge_request_metrics
USING
btree
(
target_project_id
,
merged_at
DESC
NULLS
LAST
);
CREATE
INDEX
index_mr_metrics_on_target_project_id_merged_at_nulls_last
ON
merge_request_metrics
USING
btree
(
target_project_id
,
merged_at
DESC
NULLS
LAST
,
id
DESC
);
CREATE
UNIQUE
INDEX
index_namespace_aggregation_schedules_on_namespace_id
ON
namespace_aggregation_schedules
USING
btree
(
namespace_id
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment