-- CreateEnum
CREATE TYPE "Provider" AS ENUM ('TONIC', 'ADSCOM', 'SYSTEM1', 'DOMAIN_ACTIVE');

-- CreateTable
CREATE TABLE "date_revenue" (
    "id" SERIAL NOT NULL,
    "amount" DOUBLE PRECISION NOT NULL,
    "provider" "Provider" NOT NULL,
    "date" TIMESTAMP(3) NOT NULL,
    "tonicCampaignId" INTEGER,

    CONSTRAINT "date_revenue_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "date_revenue" ADD CONSTRAINT "date_revenue_tonicCampaignId_fkey" FOREIGN KEY ("tonicCampaignId") REFERENCES "tonic_campaign"("id") ON DELETE SET NULL ON UPDATE CASCADE;
