Commit 78a7e528 authored by Felipe Artur's avatar Felipe Artur

Remove pipeline_id column from requirements_management_test_reports

Given the feature changes this column is no longer needed.
parent a0efb830
---
title: Remove pipeline_id column from requirements_test_reports
merge_request: 38924
author:
type: deprecated
# frozen_string_literal: true
class RemovePipelineIdFromTestReports < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
remove_column :requirements_management_test_reports, :pipeline_id
end
def down
add_column :requirements_management_test_reports, :pipeline_id, :integer
with_lock_retries do
# rubocop:disable Migration/AddConcurrentForeignKey
add_foreign_key :requirements_management_test_reports, :ci_pipelines, column: :pipeline_id, on_delete: :nullify
# rubocop:enable Migration/AddConcurrentForeignKey
end
end
end
66653e275889da8e695843f648af36c8a4e275b4d3215119eab4942db1b4b823
\ No newline at end of file
......@@ -15102,7 +15102,6 @@ CREATE TABLE public.requirements_management_test_reports (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
requirement_id bigint NOT NULL,
pipeline_id bigint,
author_id bigint,
state smallint NOT NULL,
build_id bigint
......@@ -20617,8 +20616,6 @@ CREATE INDEX index_requirements_management_test_reports_on_author_id ON public.r
CREATE INDEX index_requirements_management_test_reports_on_build_id ON public.requirements_management_test_reports USING btree (build_id);
CREATE INDEX index_requirements_management_test_reports_on_pipeline_id ON public.requirements_management_test_reports USING btree (pipeline_id);
CREATE INDEX index_requirements_management_test_reports_on_requirement_id ON public.requirements_management_test_reports USING btree (requirement_id);
CREATE INDEX index_requirements_on_author_id ON public.requirements USING btree (author_id);
......@@ -22176,9 +22173,6 @@ ALTER TABLE ONLY public.service_desk_settings
ALTER TABLE ONLY public.group_custom_attributes
ADD CONSTRAINT fk_rails_246e0db83a FOREIGN KEY (group_id) REFERENCES public.namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.requirements_management_test_reports
ADD CONSTRAINT fk_rails_24cecc1e68 FOREIGN KEY (pipeline_id) REFERENCES public.ci_pipelines(id) ON DELETE SET NULL;
ALTER TABLE ONLY public.cluster_agents
ADD CONSTRAINT fk_rails_25e9fc2d5d FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;
......
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