-- AlterTable
ALTER TABLE "WarmupLog" ADD COLUMN "placement" TEXT;

-- CreateTable
CREATE TABLE "DailyStat" (
    "id" TEXT NOT NULL PRIMARY KEY,
    "campaignId" TEXT NOT NULL,
    "date" DATETIME NOT NULL,
    "dayIndex" INTEGER NOT NULL,
    "plannedSends" INTEGER NOT NULL,
    "plannedReplies" INTEGER NOT NULL,
    "actualSends" INTEGER NOT NULL DEFAULT 0,
    "actualReplies" INTEGER NOT NULL DEFAULT 0,
    "spamDetected" INTEGER NOT NULL DEFAULT 0,
    "spamRescued" INTEGER NOT NULL DEFAULT 0,
    "replyRateActual" REAL,
    "inboxPlacementRate" REAL,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" DATETIME NOT NULL,
    CONSTRAINT "DailyStat_campaignId_fkey" FOREIGN KEY ("campaignId") REFERENCES "WarmupCampaign" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);

-- CreateIndex
CREATE INDEX "DailyStat_campaignId_idx" ON "DailyStat"("campaignId");

-- CreateIndex
CREATE UNIQUE INDEX "DailyStat_campaignId_date_key" ON "DailyStat"("campaignId", "date");
