From 9f3f45bfb0fe0597822d1200cd89f6a4cff4cc94 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 25 Mar 2019 13:14:32 +0200 Subject: Add v2 to reserved top level routes Signed-off-by: Dmitriy Zaporozhets --- .../20190325111602_rename_v2_root_namespaces.rb | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 db/post_migrate/20190325111602_rename_v2_root_namespaces.rb (limited to 'db') diff --git a/db/post_migrate/20190325111602_rename_v2_root_namespaces.rb b/db/post_migrate/20190325111602_rename_v2_root_namespaces.rb new file mode 100644 index 00000000000..8571bb82fa0 --- /dev/null +++ b/db/post_migrate/20190325111602_rename_v2_root_namespaces.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RenameV2RootNamespaces < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + include Gitlab::Database::RenameReservedPathsMigration::V1 + + DOWNTIME = false + + disable_ddl_transaction! + + # We're taking over the /v2 namespace as it necessary for Docker client to + # work with GitLab as Dependency proxy for containers. + def up + disable_statement_timeout do + rename_root_paths 'v2' + end + end + + def down + disable_statement_timeout do + revert_renames + end + end +end -- cgit v1.2.1