cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

16 lines
366 B
SQL

ALTER TABLE "bots" ADD COLUMN "position" INTEGER NOT NULL DEFAULT 0;
WITH ranked AS (
SELECT
"id",
ROW_NUMBER() OVER (
PARTITION BY "workspaceId", "userId"
ORDER BY "updatedAt" DESC, "createdAt" ASC, "id" ASC
) - 1 AS "position"
FROM "bots"
)
UPDATE "bots"
SET "position" = ranked."position"
FROM ranked
WHERE "bots"."id" = ranked."id";