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
4765ba15
Commit
4765ba15
authored
Aug 03, 2020
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a partial index to find rows with NULL store
So a background migration can easily update those rows.
parent
932f5927
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
db/post_migrate/20200804035230_add_partial_index_on_id_to_merge_request_diffs.rb
...4035230_add_partial_index_on_id_to_merge_request_diffs.rb
+18
-0
db/schema_migrations/20200804035230
db/schema_migrations/20200804035230
+1
-0
db/structure.sql
db/structure.sql
+2
-0
No files found.
db/post_migrate/20200804035230_add_partial_index_on_id_to_merge_request_diffs.rb
0 → 100644
View file @
4765ba15
# frozen_string_literal: true
class
AddPartialIndexOnIdToMergeRequestDiffs
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_merge_request_diffs_external_diff_store_is_null'
disable_ddl_transaction!
def
up
add_concurrent_index
:merge_request_diffs
,
:id
,
where:
'external_diff_store IS NULL'
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:merge_request_diffs
,
INDEX_NAME
end
end
db/schema_migrations/20200804035230
0 → 100644
View file @
4765ba15
f1e2f11710ca7175b7a77b0f52bd204403dfcfd0b6b33cd00e3fa0d020be1287
\ No newline at end of file
db/structure.sql
View file @
4765ba15
...
@@ -19849,6 +19849,8 @@ CREATE INDEX index_merge_request_diff_commits_on_sha ON public.merge_request_dif
...
@@ -19849,6 +19849,8 @@ CREATE INDEX index_merge_request_diff_commits_on_sha ON public.merge_request_dif
CREATE
UNIQUE
INDEX
index_merge_request_diff_files_on_mr_diff_id_and_order
ON
public
.
merge_request_diff_files
USING
btree
(
merge_request_diff_id
,
relative_order
);
CREATE
UNIQUE
INDEX
index_merge_request_diff_files_on_mr_diff_id_and_order
ON
public
.
merge_request_diff_files
USING
btree
(
merge_request_diff_id
,
relative_order
);
CREATE
INDEX
index_merge_request_diffs_external_diff_store_is_null
ON
public
.
merge_request_diffs
USING
btree
(
id
)
WHERE
(
external_diff_store
IS
NULL
);
CREATE
INDEX
index_merge_request_diffs_on_external_diff_store
ON
public
.
merge_request_diffs
USING
btree
(
external_diff_store
);
CREATE
INDEX
index_merge_request_diffs_on_external_diff_store
ON
public
.
merge_request_diffs
USING
btree
(
external_diff_store
);
CREATE
INDEX
index_merge_request_diffs_on_merge_request_id_and_id
ON
public
.
merge_request_diffs
USING
btree
(
merge_request_id
,
id
);
CREATE
INDEX
index_merge_request_diffs_on_merge_request_id_and_id
ON
public
.
merge_request_diffs
USING
btree
(
merge_request_id
,
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