Skip to content
代码片段 群组 项目
提交 d29ac395 编辑于 作者: Mayra Cabrera's avatar Mayra Cabrera
浏览文件

Merge branch 'revert-6f4c741b' into 'master'

Revert "Merge branch 'bojan/requirements-table-cleanup' into 'master'"

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138974



Merged-by: default avatarMayra Cabrera <mcabrera@gitlab.com>
Approved-by: default avatarPrabakaran Murugesan <pmurugesan@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -5,41 +5,11 @@ class RemoveRequirementsIgnoredColumns < Gitlab::Database::Migration[2.2] ...@@ -5,41 +5,11 @@ class RemoveRequirementsIgnoredColumns < Gitlab::Database::Migration[2.2]
disable_ddl_transaction! disable_ddl_transaction!
CONSTRAINT_NAME = 'check_785ae25b9d'
NAME_INDEX = 'index_requirements_on_title_trigram'
FOREIGN_KEY = 'fk_rails_33fed8aa4e'
def up def up
remove_column(:requirements, :created_at, if_exists: true) # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17224
remove_column(:requirements, :updated_at, if_exists: true)
remove_column(:requirements, :author_id, if_exists: true)
remove_column(:requirements, :cached_markdown_version, if_exists: true)
remove_column(:requirements, :state, if_exists: true)
remove_column(:requirements, :title, if_exists: true)
remove_column(:requirements, :title_html, if_exists: true)
remove_column(:requirements, :description, if_exists: true)
remove_column(:requirements, :description_html, if_exists: true)
end end
def down def down
add_column(:requirements, :created_at, :datetime_with_timezone, if_not_exists: true) # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17224
add_column(:requirements, :updated_at, :datetime_with_timezone, if_not_exists: true)
add_column(:requirements, :author_id, :integer, if_not_exists: true)
add_column(:requirements, :cached_markdown_version, :integer, if_not_exists: true)
add_column(:requirements, :state, :smallint, default: 1, if_not_exists: true)
add_column(:requirements, :title, :string, limit: 255, if_not_exists: true)
add_column(:requirements, :title_html, :text, if_not_exists: true)
add_column(:requirements, :description, :text, if_not_exists: true)
add_column(:requirements, :description_html, :text, if_not_exists: true)
add_check_constraint(:requirements, "char_length(description) <= 10000", CONSTRAINT_NAME)
add_concurrent_foreign_key(:requirements, :users, column: :author_id, name: FOREIGN_KEY, on_delete: :nullify)
add_concurrent_index(:requirements, :created_at)
add_concurrent_index(:requirements, :updated_at)
add_concurrent_index(:requirements, :author_id)
add_concurrent_index(:requirements, :state)
add_concurrent_index(:requirements, :title, name: NAME_INDEX, using: :gin, opclass: { name: :gin_trgm_ops })
end end
end end
...@@ -22805,9 +22805,19 @@ ALTER SEQUENCE required_code_owners_sections_id_seq OWNED BY required_code_owner ...@@ -22805,9 +22805,19 @@ ALTER SEQUENCE required_code_owners_sections_id_seq OWNED BY required_code_owner
   
CREATE TABLE requirements ( CREATE TABLE requirements (
id bigint NOT NULL, id bigint NOT NULL,
created_at timestamp with time zone,
updated_at timestamp with time zone,
project_id integer NOT NULL, project_id integer NOT NULL,
author_id integer,
iid integer NOT NULL, iid integer NOT NULL,
cached_markdown_version integer,
state smallint DEFAULT 1,
title character varying(255),
title_html text,
description text,
description_html text,
issue_id bigint, issue_id bigint,
CONSTRAINT check_785ae25b9d CHECK ((char_length(description) <= 10000)),
CONSTRAINT check_requirement_issue_not_null CHECK ((issue_id IS NOT NULL)) CONSTRAINT check_requirement_issue_not_null CHECK ((issue_id IS NOT NULL))
); );
   
...@@ -34357,12 +34367,22 @@ CREATE INDEX index_requirements_management_test_reports_on_build_id ON requireme ...@@ -34357,12 +34367,22 @@ CREATE INDEX index_requirements_management_test_reports_on_build_id ON requireme
   
CREATE INDEX index_requirements_management_test_reports_on_issue_id ON requirements_management_test_reports USING btree (issue_id); CREATE INDEX index_requirements_management_test_reports_on_issue_id ON requirements_management_test_reports USING btree (issue_id);
   
CREATE INDEX index_requirements_on_author_id ON requirements USING btree (author_id);
CREATE INDEX index_requirements_on_created_at ON requirements USING btree (created_at);
CREATE UNIQUE INDEX index_requirements_on_issue_id ON requirements USING btree (issue_id); CREATE UNIQUE INDEX index_requirements_on_issue_id ON requirements USING btree (issue_id);
   
CREATE INDEX index_requirements_on_project_id ON requirements USING btree (project_id); CREATE INDEX index_requirements_on_project_id ON requirements USING btree (project_id);
   
CREATE UNIQUE INDEX index_requirements_on_project_id_and_iid ON requirements USING btree (project_id, iid) WHERE (project_id IS NOT NULL); CREATE UNIQUE INDEX index_requirements_on_project_id_and_iid ON requirements USING btree (project_id, iid) WHERE (project_id IS NOT NULL);
   
CREATE INDEX index_requirements_on_state ON requirements USING btree (state);
CREATE INDEX index_requirements_on_title_trigram ON requirements USING gin (title gin_trgm_ops);
CREATE INDEX index_requirements_on_updated_at ON requirements USING btree (updated_at);
CREATE INDEX index_requirements_project_id_user_id_id_and_target_type ON todos USING btree (project_id, user_id, id, target_type); CREATE INDEX index_requirements_project_id_user_id_id_and_target_type ON todos USING btree (project_id, user_id, id, target_type);
   
CREATE INDEX index_requirements_user_id_and_target_type ON todos USING btree (user_id, target_type); CREATE INDEX index_requirements_user_id_and_target_type ON todos USING btree (user_id, target_type);
...@@ -38644,6 +38664,9 @@ ALTER TABLE ONLY alert_management_alert_metric_images ...@@ -38644,6 +38664,9 @@ ALTER TABLE ONLY alert_management_alert_metric_images
ALTER TABLE ONLY suggestions ALTER TABLE ONLY suggestions
ADD CONSTRAINT fk_rails_33b03a535c FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_33b03a535c FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
   
ALTER TABLE ONLY requirements
ADD CONSTRAINT fk_rails_33fed8aa4e FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY metrics_dashboard_annotations ALTER TABLE ONLY metrics_dashboard_annotations
ADD CONSTRAINT fk_rails_345ab51043 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_345ab51043 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
   
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册