-- DropForeignKey
ALTER TABLE "ad_stat" DROP CONSTRAINT "ad_stat_fbAdIdRef_fkey";

-- DropForeignKey
ALTER TABLE "ad_stat" DROP CONSTRAINT "ad_stat_tikTokAdIdRef_fkey";

-- AlterTable
ALTER TABLE "ad_stat" ALTER COLUMN "tikTokAdIdRef" DROP NOT NULL,
ALTER COLUMN "fbAdIdRef" DROP NOT NULL;

-- AddForeignKey
ALTER TABLE "ad_stat" ADD CONSTRAINT "ad_stat_tikTokAdIdRef_fkey" FOREIGN KEY ("tikTokAdIdRef") REFERENCES "tiktok_ad"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ad_stat" ADD CONSTRAINT "ad_stat_fbAdIdRef_fkey" FOREIGN KEY ("fbAdIdRef") REFERENCES "facebook_ad"("id") ON DELETE SET NULL ON UPDATE CASCADE;
