summaryrefslogtreecommitdiff
path: root/db/post_migrate
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-11-06 12:23:00 +0000
committerAndreas Brandl <abrandl@gitlab.com>2018-11-06 12:23:00 +0000
commit477d2e1a4708f0265d713c0f6a58ba86c97a46b4 (patch)
treedfc8a97886b6d410c4c59d48ab7d3b66bd35f594 /db/post_migrate
parentd19a6f686c32ed4892b4698f77e69e47890ad678 (diff)
downloadgitlab-ce-477d2e1a4708f0265d713c0f6a58ba86c97a46b4.tar.gz
Add background migration for Kubernetes Namespaces
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb b/db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb
new file mode 100644
index 00000000000..f80a2aa6eac
--- /dev/null
+++ b/db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class EnqueuePopulateClusterKubernetesNamespace < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ MIGRATION = 'PopulateClusterKubernetesNamespaceTable'.freeze
+
+ disable_ddl_transaction!
+
+ def up
+ BackgroundMigrationWorker.perform_async(MIGRATION)
+ end
+
+ def down
+ Clusters::KubernetesNamespace.delete_all
+ end
+end