Commit 72438f10 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Remove namespaces.plan_id column

This column is unused and already ignored in the previous release
parent 0138be44
---
title: Remove namespaces.plan_id column
merge_request: 30351
author:
type: other
# frozen_string_literal: true
class DropNamespacesPlanId < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
with_lock_retries do # rubocop: disable Migration/WithLockRetriesWithoutDdlTransaction
remove_column :namespaces, :plan_id
end
end
def down
unless column_exists?(:namespaces, :plan_id)
with_lock_retries do # rubocop: disable Migration/WithLockRetriesWithoutDdlTransaction
add_column :namespaces, :plan_id, :integer
end
end
add_concurrent_index :namespaces, :plan_id
add_concurrent_foreign_key :namespaces, :plans, column: :plan_id, on_delete: :nullify
end
end
...@@ -4100,7 +4100,6 @@ CREATE TABLE public.namespaces ( ...@@ -4100,7 +4100,6 @@ CREATE TABLE public.namespaces (
require_two_factor_authentication boolean DEFAULT false NOT NULL, require_two_factor_authentication boolean DEFAULT false NOT NULL,
two_factor_grace_period integer DEFAULT 48 NOT NULL, two_factor_grace_period integer DEFAULT 48 NOT NULL,
cached_markdown_version integer, cached_markdown_version integer,
plan_id integer,
project_creation_level integer, project_creation_level integer,
runners_token character varying, runners_token character varying,
trial_ends_on timestamp with time zone, trial_ends_on timestamp with time zone,
...@@ -9893,8 +9892,6 @@ CREATE INDEX index_namespaces_on_path ON public.namespaces USING btree (path); ...@@ -9893,8 +9892,6 @@ CREATE INDEX index_namespaces_on_path ON public.namespaces USING btree (path);
CREATE INDEX index_namespaces_on_path_trigram ON public.namespaces USING gin (path public.gin_trgm_ops); CREATE INDEX index_namespaces_on_path_trigram ON public.namespaces USING gin (path public.gin_trgm_ops);
CREATE INDEX index_namespaces_on_plan_id ON public.namespaces USING btree (plan_id);
CREATE UNIQUE INDEX index_namespaces_on_push_rule_id ON public.namespaces USING btree (push_rule_id); CREATE UNIQUE INDEX index_namespaces_on_push_rule_id ON public.namespaces USING btree (push_rule_id);
CREATE INDEX index_namespaces_on_require_two_factor_authentication ON public.namespaces USING btree (require_two_factor_authentication); CREATE INDEX index_namespaces_on_require_two_factor_authentication ON public.namespaces USING btree (require_two_factor_authentication);
...@@ -11332,9 +11329,6 @@ ALTER TABLE ONLY public.system_note_metadata ...@@ -11332,9 +11329,6 @@ ALTER TABLE ONLY public.system_note_metadata
ALTER TABLE ONLY public.merge_requests ALTER TABLE ONLY public.merge_requests
ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES public.ci_pipelines(id) ON DELETE SET NULL; ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES public.ci_pipelines(id) ON DELETE SET NULL;
ALTER TABLE ONLY public.namespaces
ADD CONSTRAINT fk_fdd12e5b80 FOREIGN KEY (plan_id) REFERENCES public.plans(id) ON DELETE SET NULL;
ALTER TABLE ONLY public.project_import_data ALTER TABLE ONLY public.project_import_data
ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE; ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;
...@@ -13562,6 +13556,7 @@ COPY "schema_migrations" (version) FROM STDIN; ...@@ -13562,6 +13556,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200423080607 20200423080607
20200423081409 20200423081409
20200423101529 20200423101529
20200424043515
20200424050250 20200424050250
20200427064130 20200427064130
\. \.
......
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