PHP Classes

File: SQL File

Recommend this page to a friend!
  Packages of Matthew Asham   Binkterm PHP   database/migrations/v1.6.4_add_password_reset_tokens.sql   Download  
File: database/migrations/v1.6.4_add_password_reset_tokens.sql
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Binkterm PHP
Bulletin board system based on the Web
Author: By
Last change:
Date: 1 month ago
Size: 846 bytes
 

Contents

Class file image Download
-- Migration: Add password reset token system -- Version: 1.6.4 -- Date: 2025-10-12 -- Create password_reset_tokens table CREATE TABLE IF NOT EXISTS password_reset_tokens ( id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, token VARCHAR(64) UNIQUE NOT NULL, expires_at TIMESTAMPTZ NOT NULL, created_at TIMESTAMPTZ DEFAULT (NOW() AT TIME ZONE 'UTC'), used_at TIMESTAMPTZ, ip_address INET, user_agent TEXT ); -- Create indexes for efficient lookups CREATE INDEX IF NOT EXISTS idx_password_reset_tokens_token ON password_reset_tokens(token); CREATE INDEX IF NOT EXISTS idx_password_reset_tokens_user_id ON password_reset_tokens(user_id); CREATE INDEX IF NOT EXISTS idx_password_reset_tokens_expires_at ON password_reset_tokens(expires_at); -- Migration completed successfully