-- =============================================================================
-- BeKind Backend — Auth Password History (Future)
-- Table: user_password_history
-- Purpose: Track password changes to prevent reuse and enforce password policies
-- Depends on: 001-auth-schema.sql (users)
--
-- FUTURE: Uncomment and run this migration when implementing password history tracking
-- =============================================================================

-- Password history table (tracks password changes to prevent reuse)
-- Uncomment below when implementing password history tracking

-- CREATE TABLE IF NOT EXISTS user_password_history (
--     id               UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
--     user_id          UUID NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
--     password_hash    VARCHAR(255) NOT NULL,
--     changed_at       TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
--     changed_by       UUID REFERENCES users(id),
--     reason           TEXT
-- );

-- =============================================================================
-- INDEXES
-- =============================================================================

-- CREATE INDEX IF NOT EXISTS idx_user_password_history_user_id    ON user_password_history(user_id);
-- CREATE INDEX IF NOT EXISTS idx_user_password_history_changed_at ON user_password_history(changed_at DESC);
