11 lines
473 B
SQL
11 lines
473 B
SQL
-- 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.)';
|
|
|