Skip to content

Commit fe79f1e

Browse files
Merge pull request #846 from cedarcode/rm--change_webauthn_id_type_in_users
Change `webauthn_id` type in `users` [take 2]
2 parents 3709aff + d010095 commit fe79f1e

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def set_default_degree
6969
# created_at :datetime not null
7070
# updated_at :datetime not null
7171
# degree_id :string not null
72-
# webauthn_id :string
72+
# webauthn_id :uuid not null
7373
#
7474
# Indexes
7575
#
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class ChangeWebauthnIdToUuidInUsers < ActiveRecord::Migration[8.0]
2+
def change
3+
# rubocop:disable Rails/BulkChangeTable
4+
remove_column :users, :webauthn_id, :string
5+
add_column :users, :webauthn_id, :uuid, null: false, default: -> { "gen_random_uuid()" }
6+
# rubocop:enable Rails/BulkChangeTable
7+
end
8+
end

db/schema.rb

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/system/manage_passkeys_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
RSpec.describe 'Manage passkeys' do
44
before do
5-
sign_in create(:user, webauthn_id: "a1b2c3d4e5f6g7h8")
5+
sign_in create(:user)
66
end
77

88
ENV['ENABLE_PASSKEYS'] = 'true'

0 commit comments

Comments
 (0)