veza/veza-backend-api/migrations/044_add_sessions_revoked_at.sql

12 lines
473 B
MySQL
Raw Normal View History

2025-12-03 19:29:37 +00:00
-- Migration: Add revoked_at column to sessions table
-- Description: Add revoked_at timestamp to track revoked sessions
ALTER TABLE sessions ADD COLUMN IF NOT EXISTS revoked_at TIMESTAMP WITH TIME ZONE;
-- Index for revoked sessions
CREATE INDEX IF NOT EXISTS idx_sessions_revoked_at ON sessions(revoked_at) WHERE revoked_at IS NOT NULL;
-- Comments
COMMENT ON COLUMN sessions.revoked_at IS 'Timestamp when the session was revoked (for logout, password reset, etc.)';