summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-09-15 16:29:16 +0000
committerRobert Speicher <robert@gitlab.com>2016-09-15 16:29:16 +0000
commit44a4274c0e0f148bbf031dc6e0eadb20fed60d92 (patch)
treec1ab04c453ee6e6bf670ce7d086f0c31790763db /db
parent7b25add30f7838e1ff9726887cf90dc36406d2a1 (diff)
parent02bc717f3423b2eb84328f4d908862db10ec76ce (diff)
downloadgitlab-ce-44a4274c0e0f148bbf031dc6e0eadb20fed60d92.tar.gz
Merge branch 'fix-old-migration-repos-path-key' into 'master'
Update references to deprecated `repos_path` configuration key to avoid ## What does this MR do? Update references to deprecated `repos_path` configuration key to avoid errors when updating GitLab from older versions ## Why was this MR needed? Users were reporting errors when upgrading from GitLab 6.7 ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1464 See merge request !6350
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140502125220_migrate_repo_size.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/db/migrate/20140502125220_migrate_repo_size.rb b/db/migrate/20140502125220_migrate_repo_size.rb
index 84463727b3b..e8de7ccf3db 100644
--- a/db/migrate/20140502125220_migrate_repo_size.rb
+++ b/db/migrate/20140502125220_migrate_repo_size.rb
@@ -1,12 +1,15 @@
# rubocop:disable all
class MigrateRepoSize < ActiveRecord::Migration
+ DOWNTIME = false
+
def up
project_data = execute('SELECT projects.id, namespaces.path AS namespace_path, projects.path AS project_path FROM projects LEFT JOIN namespaces ON projects.namespace_id = namespaces.id')
project_data.each do |project|
id = project['id']
namespace_path = project['namespace_path'] || ''
- path = File.join(Gitlab.config.gitlab_shell.repos_path, namespace_path, project['project_path'] + '.git')
+ repos_path = Gitlab.config.gitlab_shell['repos_path'] || Gitlab.config.repositories.storages.default
+ path = File.join(repos_path, namespace_path, project['project_path'] + '.git')
begin
repo = Gitlab::Git::Repository.new(path)