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
d9987355
Commit
d9987355
authored
May 25, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `latest_pipeline_id` column to `vulnerability_statistics` table
Changelog: added
parent
4592b03a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
1 deletion
+51
-1
db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb
...latest_pipeline_id_into_vulnerability_statistics_table.rb
+7
-0
db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb
...ndex_to_vulnerability_statistics_on_latest_pipeline_id.rb
+17
-0
db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb
...add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb
+17
-0
db/schema_migrations/20210525184900
db/schema_migrations/20210525184900
+1
-0
db/schema_migrations/20210526181820
db/schema_migrations/20210526181820
+1
-0
db/schema_migrations/20210526181821
db/schema_migrations/20210526181821
+1
-0
db/structure.sql
db/structure.sql
+7
-1
No files found.
db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb
0 → 100644
View file @
d9987355
# frozen_string_literal: true
class
AddLatestPipelineIdIntoVulnerabilityStatisticsTable
<
ActiveRecord
::
Migration
[
6.0
]
def
change
add_column
:vulnerability_statistics
,
:latest_pipeline_id
,
:bigint
end
end
db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb
0 → 100644
View file @
d9987355
# frozen_string_literal: true
class
AddIndexToVulnerabilityStatisticsOnLatestPipelineId
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
INDEX_NAME
=
'index_vulnerability_statistics_on_latest_pipeline_id'
disable_ddl_transaction!
def
up
add_concurrent_index
:vulnerability_statistics
,
:latest_pipeline_id
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:vulnerability_statistics
,
INDEX_NAME
end
end
db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb
0 → 100644
View file @
d9987355
# frozen_string_literal: true
class
AddForeignKeyForLatestPipelineIdToCiPipelines
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
def
up
add_concurrent_foreign_key
:vulnerability_statistics
,
:ci_pipelines
,
column: :latest_pipeline_id
,
on_delete: :nullify
end
def
down
with_lock_retries
do
remove_foreign_key_if_exists
:vulnerability_statistics
,
:ci_pipelines
end
end
end
db/schema_migrations/20210525184900
0 → 100644
View file @
d9987355
ae91ea7481ea21ce29b4c0697f77fd83017c36d913739ed67e5c907a48c56f69
\ No newline at end of file
db/schema_migrations/20210526181820
0 → 100644
View file @
d9987355
e72471e63dc108939473232437eda4c718382630c1173ae20023002d382e5ffa
\ No newline at end of file
db/schema_migrations/20210526181821
0 → 100644
View file @
d9987355
3c53d85bec154ec68a23841d37317d10fa6c7c846bc5f54f5b7876081105ac7b
\ No newline at end of file
db/structure.sql
View file @
d9987355
...
@@ -19247,7 +19247,8 @@ CREATE TABLE vulnerability_statistics (
...
@@ -19247,7 +19247,8 @@ CREATE TABLE vulnerability_statistics (
low integer DEFAULT 0 NOT NULL,
low integer DEFAULT 0 NOT NULL,
unknown integer DEFAULT 0 NOT NULL,
unknown integer DEFAULT 0 NOT NULL,
info integer DEFAULT 0 NOT NULL,
info integer DEFAULT 0 NOT NULL,
letter_grade smallint NOT NULL
letter_grade smallint NOT NULL,
latest_pipeline_id bigint
);
);
CREATE SEQUENCE vulnerability_statistics_id_seq
CREATE SEQUENCE vulnerability_statistics_id_seq
...
@@ -24863,6 +24864,8 @@ CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum
...
@@ -24863,6 +24864,8 @@ CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum
CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_id);
CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_id);
CREATE INDEX index_vulnerability_statistics_on_latest_pipeline_id ON vulnerability_statistics USING btree (latest_pipeline_id);
CREATE INDEX index_vulnerability_statistics_on_letter_grade ON vulnerability_statistics USING btree (letter_grade);
CREATE INDEX index_vulnerability_statistics_on_letter_grade ON vulnerability_statistics USING btree (letter_grade);
CREATE UNIQUE INDEX index_vulnerability_statistics_on_unique_project_id ON vulnerability_statistics USING btree (project_id);
CREATE UNIQUE INDEX index_vulnerability_statistics_on_unique_project_id ON vulnerability_statistics USING btree (project_id);
...
@@ -25964,6 +25967,9 @@ ALTER TABLE ONLY sprints
...
@@ -25964,6 +25967,9 @@ ALTER TABLE ONLY sprints
ALTER TABLE ONLY application_settings
ALTER TABLE ONLY application_settings
ADD CONSTRAINT fk_e8a145f3a7 FOREIGN KEY (instance_administrators_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
ADD CONSTRAINT fk_e8a145f3a7 FOREIGN KEY (instance_administrators_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
ALTER TABLE ONLY vulnerability_statistics
ADD CONSTRAINT fk_e8b13c928f FOREIGN KEY (latest_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
ALTER TABLE ONLY ci_triggers
ALTER TABLE ONLY ci_triggers
ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;
ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;
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