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
07fd8948
Commit
07fd8948
authored
Dec 20, 2021
by
Jonathan Schafer
Committed by
Mayra Cabrera
Dec 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary finding evidence tables
parent
02917968
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
207 deletions
+130
-207
db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb
...3510_remove_extra_finding_evidence_tables_foreign_keys.rb
+57
-0
db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb
...te/20211207173511_remove_extra_finding_evidence_tables.rb
+71
-0
db/schema_migrations/20211207173510
db/schema_migrations/20211207173510
+1
-0
db/schema_migrations/20211207173511
db/schema_migrations/20211207173511
+1
-0
db/structure.sql
db/structure.sql
+0
-201
lib/gitlab/database/gitlab_schemas.yml
lib/gitlab/database/gitlab_schemas.yml
+0
-6
No files found.
db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb
0 → 100644
View file @
07fd8948
# frozen_string_literal: true
class
RemoveExtraFindingEvidenceTablesForeignKeys
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
def
up
with_lock_retries
do
remove_foreign_key
:vulnerability_finding_evidence_assets
,
:vulnerability_finding_evidences
remove_foreign_key
:vulnerability_finding_evidence_headers
,
:vulnerability_finding_evidence_requests
remove_foreign_key
:vulnerability_finding_evidence_headers
,
:vulnerability_finding_evidence_responses
remove_foreign_key
:vulnerability_finding_evidence_requests
,
:vulnerability_finding_evidences
remove_foreign_key
:vulnerability_finding_evidence_requests
,
:vulnerability_finding_evidence_supporting_messages
remove_foreign_key
:vulnerability_finding_evidence_responses
,
:vulnerability_finding_evidences
remove_foreign_key
:vulnerability_finding_evidence_responses
,
:vulnerability_finding_evidence_supporting_messages
remove_foreign_key
:vulnerability_finding_evidence_sources
,
:vulnerability_finding_evidences
remove_foreign_key
:vulnerability_finding_evidence_supporting_messages
,
:vulnerability_finding_evidences
end
end
def
down
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_assets
,
:vulnerability_finding_evidences
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_headers
,
:vulnerability_finding_evidence_requests
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_headers
,
:vulnerability_finding_evidence_responses
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_requests
,
:vulnerability_finding_evidences
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_requests
,
:vulnerability_finding_evidence_supporting_messages
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_responses
,
:vulnerability_finding_evidences
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_responses
,
:vulnerability_finding_evidence_supporting_messages
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_sources
,
:vulnerability_finding_evidences
,
on_delete: :cascade
end
with_lock_retries
do
add_foreign_key
:vulnerability_finding_evidence_supporting_messages
,
:vulnerability_finding_evidences
,
on_delete: :cascade
end
end
end
db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb
0 → 100644
View file @
07fd8948
# frozen_string_literal: true
class
RemoveExtraFindingEvidenceTables
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
def
up
with_lock_retries
do
drop_table
:vulnerability_finding_evidence_assets
,
if_exists:
true
drop_table
:vulnerability_finding_evidence_headers
,
if_exists:
true
drop_table
:vulnerability_finding_evidence_requests
,
if_exists:
true
drop_table
:vulnerability_finding_evidence_responses
,
if_exists:
true
drop_table
:vulnerability_finding_evidence_sources
,
if_exists:
true
drop_table
:vulnerability_finding_evidence_supporting_messages
,
if_exists:
true
end
end
def
down
create_table
:vulnerability_finding_evidence_assets
,
if_not_exists:
true
do
|
t
|
t
.
timestamps_with_timezone
null:
false
t
.
references
:vulnerability_finding_evidence
,
index:
{
name:
'finding_evidence_assets_on_finding_evidence_id'
},
null:
false
t
.
text
:type
,
limit:
2048
t
.
text
:name
,
limit:
2048
t
.
text
:url
,
limit:
2048
end
create_table
:vulnerability_finding_evidence_sources
,
if_not_exists:
true
do
|
t
|
t
.
timestamps_with_timezone
null:
false
t
.
references
:vulnerability_finding_evidence
,
index:
{
name:
'finding_evidence_sources_on_finding_evidence_id'
},
null:
false
t
.
text
:name
,
limit:
2048
t
.
text
:url
,
limit:
2048
end
create_table
:vulnerability_finding_evidence_supporting_messages
,
if_not_exists:
true
do
|
t
|
t
.
timestamps_with_timezone
null:
false
t
.
references
:vulnerability_finding_evidence
,
index:
{
name:
'finding_evidence_supporting_messages_on_finding_evidence_id'
},
null:
false
t
.
text
:name
,
limit:
2048
end
create_table
:vulnerability_finding_evidence_requests
,
if_not_exists:
true
do
|
t
|
t
.
timestamps_with_timezone
null:
false
t
.
references
:vulnerability_finding_evidence
,
index:
{
name:
'finding_evidence_requests_on_finding_evidence_id'
},
null:
true
t
.
text
:method
,
limit:
32
t
.
text
:url
,
limit:
2048
t
.
text
:body
,
limit:
2048
t
.
references
:vulnerability_finding_evidence_supporting_message
,
index:
{
name:
'finding_evidence_requests_on_supporting_evidence_id'
},
null:
true
end
create_table
:vulnerability_finding_evidence_responses
,
if_not_exists:
true
do
|
t
|
t
.
timestamps_with_timezone
null:
false
t
.
references
:vulnerability_finding_evidence
,
index:
{
name:
'finding_evidence_responses_on_finding_evidences_id'
},
null:
true
t
.
integer
:status_code
t
.
text
:reason_phrase
,
limit:
2048
t
.
text
:body
,
limit:
2048
t
.
references
:vulnerability_finding_evidence_supporting_message
,
index:
{
name:
'finding_evidence_responses_on_supporting_evidence_id'
},
null:
true
end
create_table
:vulnerability_finding_evidence_headers
,
if_not_exists:
true
do
|
t
|
t
.
timestamps_with_timezone
null:
false
t
.
references
:vulnerability_finding_evidence_request
,
index:
{
name:
'finding_evidence_header_on_finding_evidence_request_id'
},
null:
true
t
.
references
:vulnerability_finding_evidence_response
,
index:
{
name:
'finding_evidence_header_on_finding_evidence_response_id'
},
null:
true
t
.
text
:name
,
null:
false
,
limit:
255
t
.
text
:value
,
null:
false
,
limit:
8192
end
end
end
db/schema_migrations/20211207173510
0 → 100644
View file @
07fd8948
0a4ac9de84b8351f39e549904d9e661648b496e6e3183c4ff5eb22b70d5ba7e9
\ No newline at end of file
db/schema_migrations/20211207173511
0 → 100644
View file @
07fd8948
8f41f45c5ef23eafae2e67951497b5752f4b30ecf73ae3c08f61febfa4fb17be
\ No newline at end of file
db/structure.sql
View file @
07fd8948
This diff is collapsed.
Click to expand it.
lib/gitlab/database/gitlab_schemas.yml
View file @
07fd8948
...
@@ -521,13 +521,7 @@ vulnerabilities: :gitlab_main
...
@@ -521,13 +521,7 @@ vulnerabilities: :gitlab_main
vulnerability_exports
:
:gitlab_main
vulnerability_exports
:
:gitlab_main
vulnerability_external_issue_links
:
:gitlab_main
vulnerability_external_issue_links
:
:gitlab_main
vulnerability_feedback
:
:gitlab_main
vulnerability_feedback
:
:gitlab_main
vulnerability_finding_evidence_assets
:
:gitlab_main
vulnerability_finding_evidence_headers
:
:gitlab_main
vulnerability_finding_evidence_requests
:
:gitlab_main
vulnerability_finding_evidence_responses
:
:gitlab_main
vulnerability_finding_evidences
:
:gitlab_main
vulnerability_finding_evidences
:
:gitlab_main
vulnerability_finding_evidence_sources
:
:gitlab_main
vulnerability_finding_evidence_supporting_messages
:
:gitlab_main
vulnerability_finding_links
:
:gitlab_main
vulnerability_finding_links
:
:gitlab_main
vulnerability_finding_signatures
:
:gitlab_main
vulnerability_finding_signatures
:
:gitlab_main
vulnerability_findings_remediations
:
:gitlab_main
vulnerability_findings_remediations
:
:gitlab_main
...
...
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