diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-06-05 07:00:25 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-06-05 07:00:25 +0300 |
commit | c503429e5e8538649bec02d74963ec0eb8f0cb98 (patch) | |
tree | 69ee0c0c320b22dae5d46d0392b16b1a89e65aae /db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb | |
parent | 160cc6cd7b0218cdd1e210c4133fd469ffacf656 (diff) |
Add migration to disable the usage of DSA keys
Additionally the current application setting is also updated to disable
the usage of DSA keys.
Diffstat (limited to 'db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb')
-rw-r--r-- | db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb new file mode 100644 index 00000000000..d0dcacc5b66 --- /dev/null +++ b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb @@ -0,0 +1,16 @@ +class ChangeDefaultValueForDsaKeyRestriction < ActiveRecord::Migration + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + def up + change_column :application_settings, :dsa_key_restriction, :integer, null: false, + default: -1 + + execute("UPDATE application_settings SET dsa_key_restriction = -1") + end + + def down + change_column :application_settings, :dsa_key_restriction, :integer, null: false, + default: 0 + end +end |