/*
  Warnings:

  - You are about to drop the column `binomCampaignId` on the `tonic_campaign` table. All the data in the column will be lost.
  - You are about to drop the column `binomOfferId` on the `tonic_campaign` table. All the data in the column will be lost.
  - You are about to drop the column `keywords` on the `tonic_campaign` table. All the data in the column will be lost.
  - You are about to drop the column `pixelId` on the `tonic_campaign` table. All the data in the column will be lost.
  - You are about to drop the column `pixelToken` on the `tonic_campaign` table. All the data in the column will be lost.
  - You are about to drop the column `tonicCampaignId` on the `tonic_campaign` table. All the data in the column will be lost.
  - You are about to drop the column `tonicCampaignName` on the `tonic_campaign` table. All the data in the column will be lost.
  - Added the required column `externalId` to the `tonic_campaign` table without a default value. This is not possible if the table is not empty.
  - Added the required column `name` to the `tonic_campaign` table without a default value. This is not possible if the table is not empty.
  - Added the required column `status` to the `tonic_campaign` table without a default value. This is not possible if the table is not empty.

*/
-- CreateEnum
CREATE TYPE "TonicCampaignSatus" AS ENUM ('incomplete', 'pending', 'active', 'stopped', 'deleted');

-- DropForeignKey
ALTER TABLE "tonic_campaign" DROP CONSTRAINT "tonic_campaign_binomCampaignId_fkey";

-- AlterTable
ALTER TABLE "tonic_campaign" DROP COLUMN "binomCampaignId",
DROP COLUMN "binomOfferId",
DROP COLUMN "keywords",
DROP COLUMN "pixelId",
DROP COLUMN "pixelToken",
DROP COLUMN "tonicCampaignId",
DROP COLUMN "tonicCampaignName",
ADD COLUMN     "externalId" TEXT NOT NULL,
ADD COLUMN     "name" TEXT NOT NULL,
ADD COLUMN     "status" "TonicCampaignSatus" NOT NULL;

-- AlterTable
ALTER TABLE "tonic_offer" ADD COLUMN     "tonicVericalId" INTEGER;

-- CreateTable
CREATE TABLE "tonic_vertical" (
    "id" SERIAL NOT NULL,
    "createDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updateDate" TIMESTAMP(3) NOT NULL,
    "name" TEXT NOT NULL,
    "available" BOOLEAN NOT NULL,

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

-- AddForeignKey
ALTER TABLE "tonic_offer" ADD CONSTRAINT "tonic_offer_tonicVericalId_fkey" FOREIGN KEY ("tonicVericalId") REFERENCES "tonic_vertical"("id") ON DELETE SET NULL ON UPDATE CASCADE;
