Add auth and ruby update
This commit is contained in:
parent
5d50194f39
commit
fbf6923835
43 changed files with 614 additions and 64 deletions
45
db/migrate/20240922172043_create_rodauth.rb
Normal file
45
db/migrate/20240922172043_create_rodauth.rb
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
class CreateRodauth < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :accounts do |t|
|
||||
t.integer :status, null: false, default: 1
|
||||
t.string :email, null: false
|
||||
t.index :email, unique: true, where: "status IN (1, 2)"
|
||||
t.string :password_hash
|
||||
end
|
||||
|
||||
# Used by the password reset feature
|
||||
# create_table :account_password_reset_keys, id: false do |t|
|
||||
# t.integer :id, primary_key: true
|
||||
# t.foreign_key :accounts, column: :id
|
||||
# t.string :key, null: false
|
||||
# t.datetime :deadline, null: false
|
||||
# t.datetime :email_last_sent, null: false, default: -> { "CURRENT_TIMESTAMP" }
|
||||
# end
|
||||
|
||||
# Used by the account verification feature
|
||||
# create_table :account_verification_keys, id: false do |t|
|
||||
# t.integer :id, primary_key: true
|
||||
# t.foreign_key :accounts, column: :id
|
||||
# t.string :key, null: false
|
||||
# t.datetime :requested_at, null: false, default: -> { "CURRENT_TIMESTAMP" }
|
||||
# t.datetime :email_last_sent, null: false, default: -> { "CURRENT_TIMESTAMP" }
|
||||
# end
|
||||
|
||||
# Used by the verify login change feature
|
||||
# create_table :account_login_change_keys, id: false do |t|
|
||||
# t.integer :id, primary_key: true
|
||||
# t.foreign_key :accounts, column: :id
|
||||
# t.string :key, null: false
|
||||
# t.string :login, null: false
|
||||
# t.datetime :deadline, null: false
|
||||
# end
|
||||
|
||||
# Used by the remember me feature
|
||||
create_table :account_remember_keys, id: false do |t|
|
||||
t.integer :id, primary_key: true
|
||||
t.foreign_key :accounts, column: :id
|
||||
t.string :key, null: false
|
||||
t.datetime :deadline, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue