diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-12-03 14:29:51 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-12-03 14:29:51 +0100 |
commit | 239a4f72642b2df0cc057a17daadf1391332d118 (patch) | |
tree | d88b8cd131d056f38bad3188487ac0ef63d9044c /lib | |
parent | e9abacedb01efdb127580dae54a6ffbe8c8c1399 (diff) | |
download | gitlab-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.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/background_migration/encrypt_runners_tokens.rb | 4 |
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 |