/*
  Warnings:

  - The values [USED] on the enum `Status` will be removed. If these variants are still used in the database, this will fail.

*/
-- AlterEnum
BEGIN;
CREATE TYPE "Status_new" AS ENUM ('CREATED', 'ACTIVE', 'INACTIVE');
ALTER TABLE "Product" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "Customer" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "Service" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "Work" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "CustomerBranch" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "Employee" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "Branch" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "ProductGroup" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "ProductType" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "User" ALTER COLUMN "status" DROP DEFAULT;
ALTER TABLE "Branch" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "User" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "Customer" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "CustomerBranch" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "Employee" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "Service" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "Work" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "ProductGroup" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "ProductType" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TABLE "Product" ALTER COLUMN "status" TYPE "Status_new" USING ("status"::text::"Status_new");
ALTER TYPE "Status" RENAME TO "Status_old";
ALTER TYPE "Status_new" RENAME TO "Status";
DROP TYPE "Status_old";
ALTER TABLE "Product" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "Customer" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "Service" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "Work" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "CustomerBranch" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "Employee" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "Branch" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "ProductGroup" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "ProductType" ALTER COLUMN "status" SET DEFAULT 'CREATED';
ALTER TABLE "User" ALTER COLUMN "status" SET DEFAULT 'CREATED';
COMMIT;
