This commit is contained in:
parent
cef4707307
commit
58392b7d6a
10 changed files with 80 additions and 122 deletions
|
|
@ -1240,6 +1240,28 @@ CREATE INDEX IF NOT EXISTS idx_refresh_families_family_id ON refresh_token_famil
|
|||
CREATE INDEX IF NOT EXISTS idx_refresh_families_active ON refresh_token_families(user_id, revoked) WHERE revoked = FALSE;
|
||||
CREATE INDEX IF NOT EXISTS idx_refresh_families_expires ON refresh_token_families(expires_at) WHERE revoked = FALSE;
|
||||
|
||||
-- Add previous_token_hash for grace period during token rotation (multi-tab support)
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name = 'refresh_token_families' AND column_name = 'previous_token_hash'
|
||||
) THEN
|
||||
ALTER TABLE refresh_token_families ADD COLUMN previous_token_hash VARCHAR(64);
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- Add previous_hash_expires_at for grace period expiry
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name = 'refresh_token_families' AND column_name = 'previous_hash_expires_at'
|
||||
) THEN
|
||||
ALTER TABLE refresh_token_families ADD COLUMN previous_hash_expires_at TIMESTAMP WITH TIME ZONE;
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- ============================================
|
||||
-- SCREENSAVER SETTINGS
|
||||
-- ============================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue