diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 14:02:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 14:02:35 +0300 |
commit | 434a0ce52d75e13d48eac9ce83774954c7c5d48d (patch) | |
tree | de3b7a7cf1ce8b07555f28df592297c76894c90f /db/migrate/20201117075742_change_webauthn_xid_length.rb | |
parent | 0a0d9493ca481c56b739a3df27c31262283150fe (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc2
Diffstat (limited to 'db/migrate/20201117075742_change_webauthn_xid_length.rb')
-rw-r--r-- | db/migrate/20201117075742_change_webauthn_xid_length.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20201117075742_change_webauthn_xid_length.rb b/db/migrate/20201117075742_change_webauthn_xid_length.rb new file mode 100644 index 00000000000..2d836662e01 --- /dev/null +++ b/db/migrate/20201117075742_change_webauthn_xid_length.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ChangeWebauthnXidLength < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_text_limit :webauthn_registrations, :credential_xid, 340, constraint_name: check_constraint_name(:webauthn_registrations, :credential_xid, 'max_length_v2') + remove_text_limit :webauthn_registrations, :credential_xid, constraint_name: check_constraint_name(:webauthn_registrations, :credential_xid, 'max_length') + end + + def down + # no-op: Danger of failling if there are records with length(credential_xid) > 255 + end +end |