Archived
- Seed now resets the database and seeds the Aldenfell campaign from the campaign book: admin DM user, default weapons, locations, bestiary, pre-built encounters, and DM/shared notes - Default weapon/spell/monster library, character profile fields, locations and dice mode (new migration) - Party overview page, pagination, info tips, build preview calc - Remove stale demo-login hint; notes preserve line breaks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
962 B
SQL
27 lines
962 B
SQL
-- CreateEnum
|
|
CREATE TYPE "DiceMode" AS ENUM ('DIGITAL', 'PHYSICAL');
|
|
|
|
-- AlterTable
|
|
ALTER TABLE "characters" ADD COLUMN "appearance" TEXT,
|
|
ADD COLUMN "background" TEXT,
|
|
ADD COLUMN "currentLocationId" TEXT,
|
|
ADD COLUMN "diceMode" "DiceMode" NOT NULL DEFAULT 'DIGITAL',
|
|
ADD COLUMN "privateNotes" TEXT;
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "locations" (
|
|
"id" TEXT NOT NULL,
|
|
"campaignId" TEXT NOT NULL,
|
|
"name" TEXT NOT NULL,
|
|
"description" TEXT,
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT "locations_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "locations" ADD CONSTRAINT "locations_campaignId_fkey" FOREIGN KEY ("campaignId") REFERENCES "campaigns"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "characters" ADD CONSTRAINT "characters_currentLocationId_fkey" FOREIGN KEY ("currentLocationId") REFERENCES "locations"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|