chirpy_server/sql/schema/004_refresh_token.sql

13 lines
304 B
MySQL
Raw Normal View History

2024-10-25 23:31:57 +02:00
-- +goose Up
CREATE TABLE refresh_tokens (
token TEXT PRIMARY KEY,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
expires_at TIMESTAMP,
revoked_at TIMESTAMP
);
-- +goose Down
DROP TABLE refresh_tokens;