save refresh token in login route

This commit is contained in:
2026-07-05 02:57:56 +07:00
parent 19dfc4e911
commit e4007eb15a
5 changed files with 73 additions and 3 deletions
@@ -0,0 +1,11 @@
-- +goose Up
CREATE TABLE IF NOT EXISTS refresh_tokens (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id INT NOT NULL,
refresh_token TEXT NOT NULL,
CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- +goose Down
DROP TABLE IF EXISTS refresh_tokens;