Files
go-http-server/sql/schema/004_refresh_tokens.sql
2025-03-11 22:39:58 +02:00

12 lines
376 B
SQL

-- +goose Up
CREATE TABLE refresh_tokens(
token TEXT PRIMARY KEY,
created_at TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
user_id UUID not null REFERENCES users(id) ON DELETE CASCADE,
expires_at timestamp not null,
revoked_at timestamp default null
);
-- +goose Down
DROP TABLE refresh_tokens;