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:
Janis4411
2022-08-02 13:57:44 +02:00
committed by Sebastian Serth
parent fe410a5306
commit d64daadd21
4 changed files with 39 additions and 1 deletions

View 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