/*
  Warnings:

  - You are about to drop the column `isManualPaycheckConnection` on the `Organization` table. All the data in the column will be lost.

*/
-- CreateEnum
CREATE TYPE "PaycheckConnectionFlow" AS ENUM ('Linked', 'Manual', 'Request');

-- AlterTable
ALTER TABLE "Member" ADD COLUMN     "paycheckConnectionFlow" "PaycheckConnectionFlow";

-- AlterTable
ALTER TABLE "Organization"
ADD COLUMN     "isPaycheckConnectionUnlinked" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "isManualPaycheckConnectionEnabled" BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN     "isRequestPaycheckConnectionEnabled" BOOLEAN NOT NULL DEFAULT true;

-- Migrate all the old isManualPaycheckConnection over to the new
UPDATE "Organization" SET "isPaycheckConnectionUnlinked" = true WHERE "isManualPaycheckConnection" = true;

-- Now we can remove the old column
ALTER TABLE "Organization" DROP COLUMN "isManualPaycheckConnection";
