Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-01-10 11:47:40 +0300
committerShinya Maeda <shinya@gitlab.com>2019-01-17 08:01:50 +0300
commitee79ee9473bad06adf1df3ec779b3d39b5e8a42f (patch)
tree33f97763d2be5c345a4acd36a646cff4980c8a3a /db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb
parent7b4ca0c903a2094c929c640754b8b9e03108b98e (diff)
Cleanup legacy artifact background migration
Add migration and spec commit 3cc12e1268a6865f524d8fab1804f018312fdf5a Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jan 8 19:34:31 2019 +0900 Add changelog to this change commit 5006fc96e38db514956a35f53ae8ee536548a2e9 Author: Shinya Maeda <shinya@gitlab.com> Date: Tue Jan 8 19:32:56 2019 +0900 Remove partial index from ci_builds artifact_file ok Update schema commit 3c956bdc02b195bc67d0327bf3748a631ea5466d Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jan 7 21:41:27 2019 +0900 Add frozen_string_literal: true commit 8c827cd616890160e6e8908843403a6f20c03236 Author: Shinya Maeda <shinya@gitlab.com> Date: Mon Jan 7 21:40:06 2019 +0900 Set batch size 100 commit aeee559777d3bdeadfd2b9bb61d460f2dc1fa8a6 Author: Shinya Maeda <shinya@gitlab.com> Date: Fri Jan 4 18:33:05 2019 +0900 Cleanup legacy artifact background migration
Diffstat (limited to 'db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb')
-rw-r--r--db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb b/db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb
new file mode 100644
index 00000000000..073faf721ae
--- /dev/null
+++ b/db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemovePartialIndexFromCiBuildsArtifactsFile < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'partial_index_ci_builds_on_id_with_legacy_artifacts'.freeze
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name(:ci_builds, INDEX_NAME)
+ end
+
+ def down
+ add_concurrent_index(:ci_builds, :id, where: "artifacts_file <> ''", name: INDEX_NAME)
+ end
+end