/*
  Warnings:

  - The values [TO_DO] on the enum `AccountFinanceRequestStatus` will be removed. If these variants are still used in the database, this will fail.
  - The `status` column on the `account_manager_request` table would be dropped and recreated. This will lead to data loss if there is data in the column.
  - You are about to drop the column `status` on the `tech_request` table. All the data in the column will be lost.

*/
-- CreateEnum
CREATE TYPE "AccountManagerRequestStatus" AS ENUM ('NEW', 'IN_PROGRESS', 'ERROR', 'DONE');

-- AlterEnum
BEGIN;
CREATE TYPE "AccountFinanceRequestStatus_new" AS ENUM ('NEW', 'IN_PROGRESS_BY_AGENCY', 'IN_PROGRESS', 'DONE');
ALTER TABLE "account_finanace_request" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "account_finanace_request" ALTER COLUMN "status" TYPE "AccountFinanceRequestStatus_new" USING ("status"::text::"AccountFinanceRequestStatus_new");
ALTER TYPE "AccountFinanceRequestStatus" RENAME TO "AccountFinanceRequestStatus_old";
ALTER TYPE "AccountFinanceRequestStatus_new" RENAME TO "AccountFinanceRequestStatus";
DROP TYPE "AccountFinanceRequestStatus_old";
ALTER TABLE "account_finanace_request" ALTER COLUMN "status" SET DEFAULT 'NEW';
COMMIT;

-- AlterEnum
ALTER TYPE "AccountFinanceRequestType" ADD VALUE 'OTHER';

-- AlterEnum
ALTER TYPE "AccountManagerRequestType" ADD VALUE 'OTHER';

-- AlterTable
ALTER TABLE "account_finanace_request" ALTER COLUMN "status" SET DEFAULT 'NEW';

-- AlterTable
ALTER TABLE "account_manager_request" DROP COLUMN "status",
ADD COLUMN     "status" "AccountManagerRequestStatus" NOT NULL DEFAULT 'NEW';

-- AlterTable
ALTER TABLE "tech_request" DROP COLUMN "status",
ADD COLUMN     "domains" TEXT;

-- DropEnum
DROP TYPE "GeneralRequestStatus";
