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
e14c41a3
Commit
e14c41a3
authored
Apr 07, 2020
by
can eldem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused index
parent
92d4d9bf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
4 deletions
+43
-4
changelogs/unreleased/drop-unused-indexes.yml
changelogs/unreleased/drop-unused-indexes.yml
+5
-0
db/post_migrate/20200407094005_drop_vulnerability_severity_index.rb
...grate/20200407094005_drop_vulnerability_severity_index.rb
+18
-0
db/post_migrate/20200407094923_drop_vulnerabilities_severity_index.rb
...ate/20200407094923_drop_vulnerabilities_severity_index.rb
+18
-0
db/structure.sql
db/structure.sql
+2
-4
No files found.
changelogs/unreleased/drop-unused-indexes.yml
0 → 100644
View file @
e14c41a3
---
title
:
Remove unused index for vulnerability severity levels
merge_request
:
29023
author
:
type
:
other
db/post_migrate/20200407094005_drop_vulnerability_severity_index.rb
0 → 100644
View file @
e14c41a3
# frozen_string_literal: true
class
DropVulnerabilitySeverityIndex
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
DOWNTIME
=
false
INDEX_NAME
=
'undefined_vulnerabilities'
def
up
remove_concurrent_index_by_name
:vulnerability_occurrences
,
INDEX_NAME
end
def
down
add_concurrent_index
(
:vulnerability_occurrences
,
:id
,
where:
'severity = 0'
,
name:
INDEX_NAME
)
end
end
db/post_migrate/20200407094923_drop_vulnerabilities_severity_index.rb
0 → 100644
View file @
e14c41a3
# frozen_string_literal: true
class
DropVulnerabilitiesSeverityIndex
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
DOWNTIME
=
false
INDEX_NAME
=
'undefined_vulnerability'
def
up
remove_concurrent_index_by_name
:vulnerabilities
,
INDEX_NAME
end
def
down
add_concurrent_index
(
:vulnerabilities
,
:id
,
where:
'severity = 0'
,
name:
INDEX_NAME
)
end
end
db/structure.sql
View file @
e14c41a3
...
...
@@ -10330,10 +10330,6 @@ CREATE INDEX tmp_build_stage_position_index ON public.ci_builds USING btree (sta
CREATE
INDEX
tmp_idx_on_user_id_where_bio_is_filled
ON
public
.
users
USING
btree
(
id
)
WHERE
((
COALESCE
(
bio
,
''
::
character
varying
))::
text
IS
DISTINCT
FROM
''
::
text
);
CREATE
INDEX
undefined_vulnerabilities
ON
public
.
vulnerability_occurrences
USING
btree
(
id
)
WHERE
(
severity
=
0
);
CREATE
INDEX
undefined_vulnerability
ON
public
.
vulnerabilities
USING
btree
(
id
)
WHERE
(
severity
=
0
);
CREATE
UNIQUE
INDEX
users_security_dashboard_projects_unique_index
ON
public
.
users_security_dashboard_projects
USING
btree
(
project_id
,
user_id
);
CREATE
UNIQUE
INDEX
vulnerability_feedback_unique_idx
ON
public
.
vulnerability_feedback
USING
btree
(
project_id
,
category
,
feedback_type
,
project_fingerprint
);
...
...
@@ -12938,5 +12934,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200403184110
20200403185127
20200403185422
20200407094005
20200407094923
\
.
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