- Campaigns: DM can archive/restore; owner can delete. Archived campaigns move off the main list and stop accepting invite codes. - Encounters: DM can archive/restore and delete, and arrange the campaign's own order; the list can also be sorted by name, status, type or date. Archived encounters are hidden from players' lists. - Account page with change password (POST /auth/password). - Seed is now additive (safe on a live database; --reset for the old wipe) and builds a fuller Aldenfell: earned weapons, item pool, spells, NPCs, and 28 battle/quest scenes with descriptions, DM notes and rewards. - Vite preview host config for the deployed site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
510 B
SQL
13 lines
510 B
SQL
-- AlterTable: an encounter can be put away, and has a place in the campaign's own order
|
|
ALTER TABLE "encounters" ADD COLUMN "archivedAt" TIMESTAMP(3);
|
|
ALTER TABLE "encounters" ADD COLUMN "sortOrder" INTEGER NOT NULL DEFAULT 0;
|
|
|
|
-- Existing encounters keep the order the list has always shown: newest first.
|
|
UPDATE "encounters" AS e
|
|
SET "sortOrder" = r.pos
|
|
FROM (
|
|
SELECT id, ROW_NUMBER() OVER (PARTITION BY "campaignId" ORDER BY "createdAt" DESC, id) - 1 AS pos
|
|
FROM "encounters"
|
|
) AS r
|
|
WHERE e.id = r.id;
|