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
9303d17f
Commit
9303d17f
authored
Jul 02, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the project_id index to be unique on vulnerability_statistics
parent
d3306a77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
db/migrate/20200702123805_change_project_id_index_to_be_unique_on_vulnerability_statistics_table.rb
...d_index_to_be_unique_on_vulnerability_statistics_table.rb
+17
-0
db/structure.sql
db/structure.sql
+2
-1
No files found.
db/migrate/20200702123805_change_project_id_index_to_be_unique_on_vulnerability_statistics_table.rb
0 → 100644
View file @
9303d17f
# frozen_string_literal: true
class
ChangeProjectIdIndexToBeUniqueOnVulnerabilityStatisticsTable
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
INDEX_NAME
=
'index_vulnerability_statistics_on_unique_project_id'
def
up
remove_index
:vulnerability_statistics
,
:project_id
# rubocop:disable Migration/RemoveIndex (table is empty)
add_index
:vulnerability_statistics
,
:project_id
,
name:
INDEX_NAME
,
unique:
true
# rubocop:disable Migration/AddIndex (table is empty)
end
def
down
remove_index
:vulnerability_statistics
,
name:
INDEX_NAME
# rubocop:disable Migration/RemoveIndex (table is empty)
add_index
:vulnerability_statistics
,
:project_id
# rubocop:disable Migration/AddIndex (table is empty)
end
end
db/structure.sql
View file @
9303d17f
...
...
@@ -20353,7 +20353,7 @@ CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id O
CREATE
INDEX
index_vulnerability_statistics_on_letter_grade
ON
public
.
vulnerability_statistics
USING
btree
(
letter_grade
);
CREATE
INDEX
index_vulnerability_statistics_on
_project_id
ON
public
.
vulnerability_statistics
USING
btree
(
project_id
);
CREATE
UNIQUE
INDEX
index_vulnerability_statistics_on_unique
_project_id
ON
public
.
vulnerability_statistics
USING
btree
(
project_id
);
CREATE
UNIQUE
INDEX
index_vulnerability_user_mentions_on_note_id
ON
public
.
vulnerability_user_mentions
USING
btree
(
note_id
)
WHERE
(
note_id
IS
NOT
NULL
);
...
...
@@ -23532,5 +23532,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200625082258
20200625190458
20200626130220
20200702123805
\
.
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