summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-12-03 14:29:51 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-12-03 14:29:51 +0100
commit239a4f72642b2df0cc057a17daadf1391332d118 (patch)
treed88b8cd131d056f38bad3188487ac0ef63d9044c /lib
parente9abacedb01efdb127580dae54a6ffbe8c8c1399 (diff)
downloadgitlab-ce-239a4f72642b2df0cc057a17daadf1391332d118.tar.gz
Use plaintext token when migration is not complete
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/background_migration/encrypt_columns.rb8
-rw-r--r--lib/gitlab/background_migration/encrypt_runners_tokens.rb4
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/background_migration/encrypt_columns.rb b/lib/gitlab/background_migration/encrypt_columns.rb
index c7549da96a8..6ec021df6fb 100644
--- a/lib/gitlab/background_migration/encrypt_columns.rb
+++ b/lib/gitlab/background_migration/encrypt_columns.rb
@@ -38,6 +38,10 @@ module Gitlab
end
end
+ def clear_migrated_values?
+ true
+ end
+
private
# Build a hash of { attribute => encrypted column name }
@@ -74,7 +78,9 @@ module Gitlab
if instance.changed?
instance.save!
- instance.update_columns(to_clear)
+ if clear_migrated_values?
+ instance.update_columns(to_clear)
+ end
end
end
diff --git a/lib/gitlab/background_migration/encrypt_runners_tokens.rb b/lib/gitlab/background_migration/encrypt_runners_tokens.rb
index cb7a4c4d52e..91e559a8765 100644
--- a/lib/gitlab/background_migration/encrypt_runners_tokens.rb
+++ b/lib/gitlab/background_migration/encrypt_runners_tokens.rb
@@ -23,6 +23,10 @@ module Gitlab
super(model, attributes, from, to)
end
+
+ def clear_migrated_values?
+ false
+ end
end
end
end