Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

336 B
Raw Blame
ALTER TABLE "user" ADD COLUMN "last_seen_at" timestamp;--> statement-breakpoint
-- The sessions still open are the only record of use there is; signed-out accounts start empty.
UPDATE "user" u SET "last_seen_at" = s."at"
FROM (SELECT "user_id", max("updated_at") AS "at" FROM "session" GROUP BY "user_id") s
WHERE s."user_id" = u."id";