/*
  Warnings:

  - You are about to drop the column `okr_score` on the `performance_result` table. All the data in the column will be lost.
  - You are about to drop the column `okr_weight` on the `performance_result` table. All the data in the column will be lost.
  - You are about to drop the `key_result` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `kr_progress_history` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `objective` table. If the table is not empty, all the data it contains will be lost.
  - Changed the type of `type` on the `assessment_template` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.

*/
-- CreateEnum
CREATE TYPE "platform_performance"."AssessmentTemplateType" AS ENUM ('KPI', 'E360', 'CUSTOM');

-- DropForeignKey
ALTER TABLE "platform_performance"."key_result" DROP CONSTRAINT "key_result_objective_id_fkey";

-- DropForeignKey
ALTER TABLE "platform_performance"."kr_progress_history" DROP CONSTRAINT "kr_progress_history_key_result_id_fkey";

-- DropForeignKey
ALTER TABLE "platform_performance"."objective" DROP CONSTRAINT "objective_cycle_id_fkey";

-- DropForeignKey
ALTER TABLE "platform_performance"."objective" DROP CONSTRAINT "objective_parent_id_fkey";

-- AlterTable
ALTER TABLE "platform_performance"."assessment_template" DROP COLUMN "type",
ADD COLUMN     "type" "platform_performance"."AssessmentTemplateType" NOT NULL;

-- AlterTable
ALTER TABLE "platform_performance"."kpi_assessment" ADD COLUMN     "quarter_scores" JSONB;

-- AlterTable
ALTER TABLE "platform_performance"."kpi_assignment" ADD COLUMN     "annual_target_value" DECIMAL(12,2),
ADD COLUMN     "quarter_targets" JSONB;

-- AlterTable
ALTER TABLE "platform_performance"."performance_result" DROP COLUMN "okr_score",
DROP COLUMN "okr_weight";

-- DropTable
DROP TABLE "platform_performance"."key_result";

-- DropTable
DROP TABLE "platform_performance"."kr_progress_history";

-- DropTable
DROP TABLE "platform_performance"."objective";

-- DropEnum
DROP TYPE "platform_performance"."MetricType";

-- DropEnum
DROP TYPE "platform_performance"."ObjectiveLevel";

-- DropEnum
DROP TYPE "platform_performance"."ObjectiveStatus";
