jws-backend/prisma/migrations/20240614084850_update_work_table/migration.sql

23 lines
758 B
MySQL
Raw Normal View History

2024-06-14 15:49:05 +07:00
/*
Warnings:
- You are about to drop the `WorkService` table. If the table is not empty, all the data it contains will be lost.
- Added the required column `order` to the `Work` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "WorkService" DROP CONSTRAINT "WorkService_serviceId_fkey";
-- DropForeignKey
ALTER TABLE "WorkService" DROP CONSTRAINT "WorkService_workId_fkey";
-- AlterTable
ALTER TABLE "Work" ADD COLUMN "order" INTEGER NOT NULL,
ADD COLUMN "serviceId" TEXT;
-- DropTable
DROP TABLE "WorkService";
-- AddForeignKey
ALTER TABLE "Work" ADD CONSTRAINT "Work_serviceId_fkey" FOREIGN KEY ("serviceId") REFERENCES "Service"("id") ON DELETE CASCADE ON UPDATE CASCADE;