Commit 07fd8948 authored by Jonathan Schafer's avatar Jonathan Schafer Committed by Mayra Cabrera

Remove unnecessary finding evidence tables

parent 02917968
# 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
# 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
0a4ac9de84b8351f39e549904d9e661648b496e6e3183c4ff5eb22b70d5ba7e9
\ No newline at end of file
8f41f45c5ef23eafae2e67951497b5752f4b30ecf73ae3c08f61febfa4fb17be
\ No newline at end of file
This diff is collapsed.
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment