diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 14:16:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 14:16:34 +0000 |
commit | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (patch) | |
tree | 2b256ff8dfe63dafe7f42b0d995f9e74fd1dc48b /db/migrate | |
parent | bd860c22f6a4b9473cbddd34a53eead8235a7ea1 (diff) | |
download | gitlab-ce-4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20190914223900_modify_concurrent_index_to_builds_metadata.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/db/migrate/20190914223900_modify_concurrent_index_to_builds_metadata.rb b/db/migrate/20190914223900_modify_concurrent_index_to_builds_metadata.rb new file mode 100644 index 00000000000..ad8979045e5 --- /dev/null +++ b/db/migrate/20190914223900_modify_concurrent_index_to_builds_metadata.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class ModifyConcurrentIndexToBuildsMetadata < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_builds_metadata, [:build_id], + where: "interruptible = true", + name: "index_ci_builds_metadata_on_build_id_and_interruptible" + remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible_false') + end + + def down + remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible') + add_concurrent_index :ci_builds_metadata, [:build_id], + where: "interruptible = false", + name: "index_ci_builds_metadata_on_build_id_and_interruptible_false" + end +end |