1
0
mirror of synced 2024-12-15 08:21:19 +01:00
Bayshore/prisma/migrations/20220725075352_cargtwing_relation/migration.sql
ghkkk090 6a70640279 fix custom color bug, fix GT wing (custom wing)
CAUTION :
DATABASE WILL GET NUKED, BACK UP FIRST

-add CarGTWing table
2022-07-25 15:23:12 +07:00

27 lines
998 B
SQL

/*
Warnings:
- You are about to drop the column `carId` on the `CarGTWing` table. All the data in the column will be lost.
- A unique constraint covering the columns `[carGTWingDbId]` on the table `Car` will be added. If there are existing duplicate values, this will fail.
- Added the required column `carGTWingDbId` to the `Car` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "CarGTWing" DROP CONSTRAINT "CarGTWing_carId_fkey";
-- DropIndex
DROP INDEX "CarGTWing_carId_key";
-- AlterTable
ALTER TABLE "Car" ADD COLUMN "carGTWingDbId" INTEGER NOT NULL,
ALTER COLUMN "stLoseBits" SET DEFAULT 0;
-- AlterTable
ALTER TABLE "CarGTWing" DROP COLUMN "carId";
-- CreateIndex
CREATE UNIQUE INDEX "Car_carGTWingDbId_key" ON "Car"("carGTWingDbId");
-- AddForeignKey
ALTER TABLE "Car" ADD CONSTRAINT "Car_carGTWingDbId_fkey" FOREIGN KEY ("carGTWingDbId") REFERENCES "CarGTWing"("dbId") ON DELETE RESTRICT ON UPDATE CASCADE;