/*
  Warnings:

  - The values [USDDollarRate,NZDDollarRate,EURDollarRate] on the enum `ExpenseCategory` will be removed. If these variants are still used in the database, this will fail.
  - A unique constraint covering the columns `[month,year,category,currency]` on the table `monthly_expenses` will be added. If there are existing duplicate values, this will fail.

*/
-- AlterEnum
BEGIN;
CREATE TYPE "ExpenseCategory_new" AS ENUM ('OfficeRent', 'OperationalExpenses', 'Depreciation', 'IncomeTax', 'GSTAndStatutoryPayments', 'ProfitPercentage', 'DollarRate');
ALTER TABLE "monthly_expenses" ALTER COLUMN "category" TYPE "ExpenseCategory_new" USING ("category"::text::"ExpenseCategory_new");
ALTER TYPE "ExpenseCategory" RENAME TO "ExpenseCategory_old";
ALTER TYPE "ExpenseCategory_new" RENAME TO "ExpenseCategory";
DROP TYPE "ExpenseCategory_old";
COMMIT;

-- DropIndex
DROP INDEX "monthly_expenses_month_year_category_key";

-- AlterTable
ALTER TABLE "monthly_expenses" ADD COLUMN     "currency" TEXT;

-- CreateIndex
CREATE UNIQUE INDEX "monthly_expenses_month_year_category_currency_key" ON "monthly_expenses"("month", "year", "category", "currency");
