completed SMS gateway project
This commit is contained in:
21
db/migrate/20251019070520_create_otp_codes.rb
Normal file
21
db/migrate/20251019070520_create_otp_codes.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class CreateOtpCodes < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :otp_codes do |t|
|
||||
t.string :phone_number, null: false
|
||||
t.string :code, null: false
|
||||
t.string :purpose, default: "authentication"
|
||||
t.datetime :expires_at, null: false
|
||||
t.boolean :verified, default: false
|
||||
t.datetime :verified_at
|
||||
t.integer :attempts, default: 0
|
||||
t.string :ip_address
|
||||
t.jsonb :metadata, default: {}
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :otp_codes, :phone_number
|
||||
add_index :otp_codes, :expires_at
|
||||
add_index :otp_codes, [:phone_number, :verified, :expires_at]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user