Commit 138d6f7c authored by Toon Claes's avatar Toon Claes

Include index name when reverting migration

parent e23d4ab3
...@@ -4,6 +4,7 @@ class RemoveCreatedByUserIdFromClusterProvidersAws < ActiveRecord::Migration[6.0 ...@@ -4,6 +4,7 @@ class RemoveCreatedByUserIdFromClusterProvidersAws < ActiveRecord::Migration[6.0
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
DOWNTIME = false DOWNTIME = false
INDEX_NAME = 'index_cluster_providers_aws_on_created_by_user_id'
disable_ddl_transaction! disable_ddl_transaction!
...@@ -18,7 +19,7 @@ class RemoveCreatedByUserIdFromClusterProvidersAws < ActiveRecord::Migration[6.0 ...@@ -18,7 +19,7 @@ class RemoveCreatedByUserIdFromClusterProvidersAws < ActiveRecord::Migration[6.0
add_column :cluster_providers_aws, :created_by_user_id, :integer add_column :cluster_providers_aws, :created_by_user_id, :integer
end end
add_concurrent_index :cluster_providers_aws, :created_by_user_id add_concurrent_index :cluster_providers_aws, :created_by_user_id, name: INDEX_NAME
add_concurrent_foreign_key :cluster_providers_aws, :users, column: :created_by_user_id, on_delete: :nullify add_concurrent_foreign_key :cluster_providers_aws, :users, column: :created_by_user_id, on_delete: :nullify
end end
......
...@@ -10701,6 +10701,7 @@ ALTER SEQUENCE cluster_projects_id_seq OWNED BY cluster_projects.id; ...@@ -10701,6 +10701,7 @@ ALTER SEQUENCE cluster_projects_id_seq OWNED BY cluster_projects.id;
CREATE TABLE cluster_providers_aws ( CREATE TABLE cluster_providers_aws (
id bigint NOT NULL, id bigint NOT NULL,
cluster_id bigint NOT NULL, cluster_id bigint NOT NULL,
created_by_user_id integer,
num_nodes integer NOT NULL, num_nodes integer NOT NULL,
status integer NOT NULL, status integer NOT NULL,
created_at timestamp with time zone NOT NULL, created_at timestamp with time zone NOT NULL,
...@@ -19805,6 +19806,8 @@ CREATE UNIQUE INDEX index_cluster_providers_aws_on_cluster_id ON cluster_provide ...@@ -19805,6 +19806,8 @@ CREATE UNIQUE INDEX index_cluster_providers_aws_on_cluster_id ON cluster_provide
CREATE INDEX index_cluster_providers_aws_on_cluster_id_and_status ON cluster_providers_aws USING btree (cluster_id, status); CREATE INDEX index_cluster_providers_aws_on_cluster_id_and_status ON cluster_providers_aws USING btree (cluster_id, status);
CREATE INDEX index_cluster_providers_aws_on_created_by_user_id ON cluster_providers_aws USING btree (created_by_user_id);
CREATE INDEX index_cluster_providers_gcp_on_cloud_run ON cluster_providers_gcp USING btree (cloud_run); CREATE INDEX index_cluster_providers_gcp_on_cloud_run ON cluster_providers_gcp USING btree (cloud_run);
CREATE UNIQUE INDEX index_cluster_providers_gcp_on_cluster_id ON cluster_providers_gcp USING btree (cluster_id); CREATE UNIQUE INDEX index_cluster_providers_gcp_on_cluster_id ON cluster_providers_gcp USING btree (cluster_id);
...@@ -23611,6 +23614,9 @@ ALTER TABLE ONLY alert_management_alert_user_mentions ...@@ -23611,6 +23614,9 @@ ALTER TABLE ONLY alert_management_alert_user_mentions
ALTER TABLE ONLY snippet_statistics ALTER TABLE ONLY snippet_statistics
ADD CONSTRAINT fk_rails_ebc283ccf1 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_ebc283ccf1 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE;
ALTER TABLE ONLY cluster_providers_aws
ADD CONSTRAINT fk_rails_ed1fdfaeb2 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY project_security_settings ALTER TABLE ONLY project_security_settings
ADD CONSTRAINT fk_rails_ed4abe1338 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_ed4abe1338 FOREIGN KEY (project_id) REFERENCES 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