summaryrefslogtreecommitdiff
path: root/db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb')
-rw-r--r--db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb b/db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb
new file mode 100644
index 00000000000..c7c18ae69d0
--- /dev/null
+++ b/db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddDevopsAdoptionSegmentNamespaceFk < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :analytics_devops_adoption_segments, :namespaces, column: :namespace_id
+ end
+
+ def down
+ remove_foreign_key_if_exists :analytics_devops_adoption_segments, :namespaces, column: :namespace_id
+ end
+end