targo-backend/prisma/migrations/20251204135338_schedule_presets_ajustments/migration.sql

21 lines
690 B
SQL

/*
Warnings:
- You are about to drop the column `employee_id` on the `schedule_presets` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE "public"."schedule_presets" DROP CONSTRAINT "schedule_presets_employee_id_fkey";
-- DropIndex
DROP INDEX "public"."schedule_presets_employee_id_name_key";
-- AlterTable
ALTER TABLE "employees" ADD COLUMN "schedule_preset_id" INTEGER;
-- AlterTable
ALTER TABLE "schedule_presets" DROP COLUMN "employee_id";
-- AddForeignKey
ALTER TABLE "employees" ADD CONSTRAINT "employees_schedule_preset_id_fkey" FOREIGN KEY ("schedule_preset_id") REFERENCES "schedule_presets"("id") ON DELETE SET NULL ON UPDATE CASCADE;