Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArturo Herrero <arturo.herrero@gmail.com>2019-11-22 17:29:53 +0300
committerAlessio Caiazza <acaiazza@gitlab.com>2019-11-26 16:02:55 +0300
commitaaae14c00eb7fff7c8868d6794231f12c7ca2165 (patch)
tree58908245d1b1bcfc58981a2bcfe2ca11ac01f066 /db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb
parent9183bf943b36f7505f4ec64c2db14dc3f641b617 (diff)
Encrypt application settings with pre and post deployments
We had concerns about the cached values on Redis with the previous two releases strategy: First release (this commit): - Create new encrypted fields in the database. - Start populating new encrypted fields, read the encrypted fields or fallback to the plaintext fields. - Backfill the data removing the plaintext fields to the encrypted fields. Second release: - Remove the virtual attribute (created in step 2). - Drop plaintext columns from the database (empty columns after step 3). We end up with a better strategy only using migration scripts in one release: - Pre-deployment migration: Add columns required for storing encrypted values. - Pre-deployment migration: Store the encrypted values in the new columns. - Post-deployment migration: Remove the old unencrypted columns
Diffstat (limited to 'db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb')
-rw-r--r--db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb6
1 files changed, 0 insertions, 6 deletions
diff --git a/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb b/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb
index d7abb29fd75..e6b9a40ad4f 100644
--- a/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb
+++ b/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb
@@ -70,12 +70,6 @@ class EncryptPlaintextAttributesOnApplicationSettings < ActiveRecord::Migration[
end
)
application_setting.save(validate: false)
-
- application_setting.update_columns(
- PLAINTEXT_ATTRIBUTES.each_with_object({}) do |plaintext_attribute, attributes|
- attributes[plaintext_attribute] = nil
- end
- )
end
end