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
512fd434
Commit
512fd434
authored
Dec 09, 2020
by
Kerri Miller
Committed by
Andreas Brandl
Dec 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `system` to existing index for notes
parent
3c2d7dc2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
1 deletion
+31
-1
changelogs/unreleased/276943-add-non-system-index-to-notes.yml
...elogs/unreleased/276943-add-non-system-index-to-notes.yml
+5
-0
db/migrate/20201201034258_add_index_for_non_system_noteables.rb
...rate/20201201034258_add_index_for_non_system_noteables.rb
+24
-0
db/schema_migrations/20201201034258
db/schema_migrations/20201201034258
+1
-0
db/structure.sql
db/structure.sql
+1
-1
No files found.
changelogs/unreleased/276943-add-non-system-index-to-notes.yml
0 → 100644
View file @
512fd434
---
title
:
Update index for notes to include `system`
merge_request
:
48864
author
:
type
:
performance
db/migrate/20201201034258_add_index_for_non_system_noteables.rb
0 → 100644
View file @
512fd434
# frozen_string_literal: true
class
AddIndexForNonSystemNoteables
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
LEGACY_INDEX_NAME
=
"index_notes_on_noteable_id_and_noteable_type"
NEW_INDEX_NAME
=
"index_notes_on_noteable_id_and_noteable_type_and_system"
def
up
add_concurrent_index
:notes
,
[
:noteable_id
,
:noteable_type
,
:system
],
name:
NEW_INDEX_NAME
remove_concurrent_index_by_name
:notes
,
LEGACY_INDEX_NAME
end
def
down
add_concurrent_index
:notes
,
[
:noteable_id
,
:noteable_type
],
name:
LEGACY_INDEX_NAME
remove_concurrent_index_by_name
:notes
,
NEW_INDEX_NAME
end
end
db/schema_migrations/20201201034258
0 → 100644
View file @
512fd434
12cc1beb73bcc31f6546066842913284aabba22ea4e93095271c0cfdacfd0858
\ No newline at end of file
db/structure.sql
View file @
512fd434
...
...
@@ -21734,7 +21734,7 @@ CREATE INDEX index_notes_on_line_code ON notes USING btree (line_code);
CREATE
INDEX
index_notes_on_note_trigram
ON
notes
USING
gin
(
note
gin_trgm_ops
);
CREATE
INDEX
index_notes_on_noteable_id_and_noteable_type
ON
notes
USING
btree
(
noteable_id
,
noteable_type
);
CREATE
INDEX
index_notes_on_noteable_id_and_noteable_type
_and_system
ON
notes
USING
btree
(
noteable_id
,
noteable_type
,
system
);
CREATE
INDEX
index_notes_on_project_id_and_id_and_system_false
ON
notes
USING
btree
(
project_id
,
id
)
WHERE
(
NOT
system
);
...
...
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