-- CreateTable
CREATE TABLE "PortalUser" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "email" TEXT NOT NULL,
    "passwordHash" TEXT NOT NULL,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- CreateTable
CREATE TABLE "PortalUserSetup" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "portalUserId" INTEGER NOT NULL,
    "setupId" INTEGER NOT NULL,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- CreateIndex
CREATE UNIQUE INDEX "PortalUser_email_key" ON "PortalUser"("email");

-- CreateIndex
CREATE INDEX "PortalUserSetup_setupId_idx" ON "PortalUserSetup"("setupId");

-- CreateIndex
CREATE UNIQUE INDEX "PortalUserSetup_portalUserId_setupId_key" ON "PortalUserSetup"("portalUserId", "setupId");
