All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 33s
22 lines
1.0 KiB
SQL
22 lines
1.0 KiB
SQL
-- Migration: Make refresh tokens permanent (no expiration)
|
|
-- Refresh tokens теперь не имеют срока действия (expires_at может быть NULL)
|
|
-- Access tokens живут 24 часа вместо 15 минут
|
|
|
|
-- ============================================
|
|
-- 1. Изменяем expires_at на NULLABLE
|
|
-- ============================================
|
|
ALTER TABLE refresh_tokens
|
|
ALTER COLUMN expires_at DROP NOT NULL;
|
|
|
|
-- ============================================
|
|
-- 2. Устанавливаем NULL для всех существующих токенов
|
|
-- (или можно оставить их как есть, если они еще не истекли)
|
|
-- ============================================
|
|
-- UPDATE refresh_tokens SET expires_at = NULL WHERE expires_at > NOW();
|
|
|
|
-- ============================================
|
|
-- 3. Комментарий
|
|
-- ============================================
|
|
COMMENT ON COLUMN refresh_tokens.expires_at IS 'Expiration date for refresh token. NULL means token never expires.';
|
|
|