summaryrefslogtreecommitdiff
path: root/lib/tasks/migrate
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2013-08-02 15:43:30 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2013-08-02 15:43:30 +0200
commit1dda34f306a94a4046d7150f5dc11a6fde360dd0 (patch)
tree8a3f3712208d76dd372a7f3127cbcf7ea6cf1836 /lib/tasks/migrate
parentb55e22e277bd754d4ab89c046ccbe8f943730c8d (diff)
downloadgitlab-ce-1dda34f306a94a4046d7150f5dc11a6fde360dd0.tar.gz
Delete duplicate keys in migrate_keys task
Diffstat (limited to 'lib/tasks/migrate')
-rw-r--r--lib/tasks/migrate/migrate_keys.rake5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tasks/migrate/migrate_keys.rake b/lib/tasks/migrate/migrate_keys.rake
index b13d984907b..969ba6dc15e 100644
--- a/lib/tasks/migrate/migrate_keys.rake
+++ b/lib/tasks/migrate/migrate_keys.rake
@@ -1,15 +1,20 @@
desc "GITLAB | Migrate SSH Keys"
task migrate_keys: :environment do
puts "This will add fingerprint to ssh keys in db"
+ puts "If you have duplicate keys https://github.com/gitlabhq/gitlabhq/issues/4453 all but the first will be deleted".yellow
ask_to_continue
Key.find_each(batch_size: 20) do |key|
if key.valid? && key.save
print '.'
+ elsif key.fingerprint.present?
+ puts "\nDeleting #{key.inspect}".yellow
+ key.destroy
else
print 'F'
end
end
+ print "\n"
end