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:
authorCédric Tabin <tabin.cedric@gmail.com>2019-09-05 17:50:39 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-09-05 17:50:39 +0300
commite195e48638dcc56609436e6fcdd9ad3521501798 (patch)
treef5bef05404ba10a9eeb897f8e9a40725019a8525 /db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb
parentbe920a6056b1b2bbc376af43d9aef8df92f090f6 (diff)
New interruptible attribute supported in YAML parsing.
Since it is not possible to dynamically detect if a job is automatically cancellable or not, a this new attribute is necessary. Moreover, it let the maintainer of the repo to adjust the behaviour of the auto cancellation feature to match exactly what he needs.
Diffstat (limited to 'db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb')
-rw-r--r--db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb b/db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb
new file mode 100644
index 00000000000..d394f995673
--- /dev/null
+++ b/db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddConcurrentIndexToBuildsMetadata < 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 = false",
+ name: "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_false')
+ end
+end