rhythm-backend/migrations/0002_refresh_token_table.sql
Dmitri ff4c9eee87
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 10m12s
added creation of access token and table for refresh token
2026-04-28 20:36:54 +02:00

11 lines
372 B
SQL

create table refresh_tokens (
id uuid primary key default uuidv4(),
user_id uuid not null references users(id) on delete cascade,
token_hash varchar(255) not null, -- SHA-256 hash of the plain token
expires_at timestamptz not null,
created_at timestamptz not null default now(),
revoked_at timestamptz,
constraint unique_token_hash unique (token_hash)
);