diff options
author | Robert Speicher <robert@gitlab.com> | 2016-09-15 16:29:16 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-09-15 16:29:16 +0000 |
commit | 44a4274c0e0f148bbf031dc6e0eadb20fed60d92 (patch) | |
tree | c1ab04c453ee6e6bf670ce7d086f0c31790763db /db | |
parent | 7b25add30f7838e1ff9726887cf90dc36406d2a1 (diff) | |
parent | 02bc717f3423b2eb84328f4d908862db10ec76ce (diff) | |
download | gitlab-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.rb | 5 |
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) |