From 3328658de02c05145461988400cca6cdabbeb0b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 15:29:40 +0000 Subject: [PATCH 1/2] Initial plan From 30102e508c7a4058ce34109633b6dc1b9447481c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 15:36:16 +0000 Subject: [PATCH 2/2] feat: add migration to remove access_tokens table Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com> --- .../1767972708_remove_access_tokens.down.sql | 22 +++++++++++++++++++ .../1767972708_remove_access_tokens.up.sql | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 services/nexus/internal/store/migrations/1767972708_remove_access_tokens.down.sql create mode 100644 services/nexus/internal/store/migrations/1767972708_remove_access_tokens.up.sql diff --git a/services/nexus/internal/store/migrations/1767972708_remove_access_tokens.down.sql b/services/nexus/internal/store/migrations/1767972708_remove_access_tokens.down.sql new file mode 100644 index 00000000..61f91c32 --- /dev/null +++ b/services/nexus/internal/store/migrations/1767972708_remove_access_tokens.down.sql @@ -0,0 +1,22 @@ +-- Recreate access_tokens table +CREATE TABLE "access_tokens" ( + "id" uuid NOT NULL DEFAULT uuid_generate_v4(), + "admin_id" uuid NOT NULL, + "token" text NOT NULL, + "revoked" bool DEFAULT false, + "expires_at" timestamptz, + "created_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + "ip" varchar(255), + "user_agent" varchar(255), + PRIMARY KEY ("id") +); + +ALTER TABLE "access_tokens" ADD FOREIGN KEY ("admin_id") REFERENCES "admins"("id") ON DELETE CASCADE; + +-- Recreate indexes +CREATE INDEX access_tokens_token_idx ON public.access_tokens USING btree (token); +CREATE INDEX access_tokens_admin_id_idx ON public.access_tokens USING btree (admin_id); + +-- Recreate trigger +CREATE TRIGGER set_updated_at_access_tokens BEFORE UPDATE ON access_tokens FOR EACH ROW EXECUTE PROCEDURE set_updated_at(); diff --git a/services/nexus/internal/store/migrations/1767972708_remove_access_tokens.up.sql b/services/nexus/internal/store/migrations/1767972708_remove_access_tokens.up.sql new file mode 100644 index 00000000..195b11a2 --- /dev/null +++ b/services/nexus/internal/store/migrations/1767972708_remove_access_tokens.up.sql @@ -0,0 +1,2 @@ +-- Drop access_tokens table (no longer used - users sign in using JWT tokens) +DROP TABLE IF EXISTS access_tokens;