added AuthenticationToken model, updated some restrictions for the authentication token table, added dependent destroy to the user model for authentication tokens
This commit is contained in:

committed by
Sebastian Serth

parent
fe410a5306
commit
d64daadd21
12
db/migrate/20220721131946_create_authentication_tokens.rb
Normal file
12
db/migrate/20220721131946_create_authentication_tokens.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateAuthenticationTokens < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :authentication_tokens, id: :uuid do |t|
|
||||
t.string :shared_secret, null: false, index: {unique: true}
|
||||
t.references :user, polymorphic: true, null: false
|
||||
t.date :expire_at, null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user