/*
  Warnings:

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

*/
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.


ALTER TYPE "ExternalServiceType" ADD VALUE 'Argyle';
ALTER TYPE "ExternalServiceType" ADD VALUE 'Tartan';

-- AlterEnum
ALTER TYPE "FinancialAccountType" ADD VALUE 'Clearing';

-- DropForeignKey
ALTER TABLE "Member" DROP CONSTRAINT "Member_destinationFinancialAccountId_fkey";

-- AlterTable
ALTER TABLE "Member" DROP COLUMN "destinationFinancialAccountId",
ADD COLUMN     "directDepositConnected" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "memberPayrollExternalServiceId" TEXT NOT NULL DEFAULT '',
ADD COLUMN     "memberPayrollExternalServiceType" "ExternalServiceType";

-- AlterTable
ALTER TABLE "Organization" ADD COLUMN     "argyleExternalServiceId" TEXT NOT NULL DEFAULT '';

-- AlterTable
ALTER TABLE "User" ADD COLUMN     "destinationFinancialAccountId" UUID;

-- AddForeignKey
ALTER TABLE "User" ADD CONSTRAINT "User_destinationFinancialAccountId_fkey" FOREIGN KEY ("destinationFinancialAccountId") REFERENCES "FinancialAccount"("id") ON DELETE SET NULL ON UPDATE CASCADE;
