From 743497aa0502781072b84eb51c2663180813b5c6 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 5 Aug 2019 12:45:04 -0700 Subject: Move migration from migrate to post_migrate This is just in case the creation of this index takes a while to create. --- ..._add_index_on_id_and_type_and_public_to_keys.rb | 23 ---------------------- ..._add_index_on_id_and_type_and_public_to_keys.rb | 23 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 db/migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb create mode 100644 db/post_migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb (limited to 'db') diff --git a/db/migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb b/db/migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb deleted file mode 100644 index 9b4d74b4bea..00000000000 --- a/db/migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnIdAndTypeAndPublicToKeys < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = "index_on_deploy_keys_id_and_type_and_public" - - def up - add_concurrent_index(:keys, - [:id, :type], - where: "public = 't'", - unique: true, - name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:keys, INDEX_NAME) - end -end diff --git a/db/post_migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb b/db/post_migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb new file mode 100644 index 00000000000..9b4d74b4bea --- /dev/null +++ b/db/post_migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddIndexOnIdAndTypeAndPublicToKeys < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = "index_on_deploy_keys_id_and_type_and_public" + + def up + add_concurrent_index(:keys, + [:id, :type], + where: "public = 't'", + unique: true, + name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(:keys, INDEX_NAME) + end +end -- cgit v1.2.3