From 37e475026d073e640fa9ca2d665575b4d0335b0b Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Wed, 12 Oct 2022 23:09:19 +0200 Subject: [PATCH] undo migrations --- .../20221011094251_initial/migration.sql | 148 ------------------ .../migration.sql | 2 - .../migration.sql | 7 - .../migration.sql | 31 ---- prisma/migrations/migration_lock.toml | 3 - 5 files changed, 191 deletions(-) delete mode 100644 prisma/migrations/20221011094251_initial/migration.sql delete mode 100644 prisma/migrations/20221011095300_bill_optional/migration.sql delete mode 100644 prisma/migrations/20221011210633_update_some_shit/migration.sql delete mode 100644 prisma/migrations/20221012204442_change_relation/migration.sql delete mode 100644 prisma/migrations/migration_lock.toml diff --git a/prisma/migrations/20221011094251_initial/migration.sql b/prisma/migrations/20221011094251_initial/migration.sql deleted file mode 100644 index da2c852..0000000 --- a/prisma/migrations/20221011094251_initial/migration.sql +++ /dev/null @@ -1,148 +0,0 @@ --- CreateEnum -CREATE TYPE "BillStatus" AS ENUM ('UNINVOICED', 'INVOICED', 'PAID'); - --- CreateEnum -CREATE TYPE "BookingStatus" AS ENUM ('REQUESTED', 'CONFIRMED', 'REJECTED', 'CANCELED'); - --- CreateTable -CREATE TABLE "AdditionalCosts" ( - "id" SERIAL NOT NULL, - "name" TEXT NOT NULL, - "value" DECIMAL(65,30) NOT NULL, - - CONSTRAINT "AdditionalCosts_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Bill" ( - "id" SERIAL NOT NULL, - "createdAt" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATE NOT NULL, - "milageEnd" INTEGER NOT NULL, - "milageStart" INTEGER NOT NULL, - "status" "BillStatus" NOT NULL DEFAULT 'UNINVOICED', - "tarif" DECIMAL(65,30) NOT NULL, - - CONSTRAINT "Bill_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Booking" ( - "id" TEXT NOT NULL, - "uuid" TEXT NOT NULL, - "createdAt" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATE NOT NULL, - "billId" INTEGER NOT NULL, - "calendarEventId" TEXT, - "city" TEXT NOT NULL, - "destination" TEXT NOT NULL, - "email" TEXT NOT NULL, - "endDate" TEXT NOT NULL, - "name" TEXT NOT NULL, - "org" TEXT NOT NULL, - "phone" TEXT NOT NULL, - "purpose" TEXT NOT NULL, - "startDate" TEXT NOT NULL, - "status" "BookingStatus" NOT NULL DEFAULT 'REQUESTED', - "street" TEXT NOT NULL, - "zip" TEXT NOT NULL, - - CONSTRAINT "Booking_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Account" ( - "id" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "type" TEXT NOT NULL, - "provider" TEXT NOT NULL, - "providerAccountId" TEXT NOT NULL, - "refresh_token" TEXT, - "access_token" TEXT, - "expires_at" INTEGER, - "token_type" TEXT, - "scope" TEXT, - "id_token" TEXT, - "session_state" TEXT, - - CONSTRAINT "Account_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Session" ( - "id" TEXT NOT NULL, - "sessionToken" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Session_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "User" ( - "id" TEXT NOT NULL, - "name" TEXT, - "email" TEXT, - "emailVerified" TIMESTAMP(3), - "image" TEXT, - - CONSTRAINT "User_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "VerificationToken" ( - "identifier" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL -); - --- CreateTable -CREATE TABLE "_AdditionalCostsToBill" ( - "A" INTEGER NOT NULL, - "B" INTEGER NOT NULL -); - --- CreateIndex -CREATE UNIQUE INDEX "Booking_uuid_key" ON "Booking"("uuid"); - --- CreateIndex -CREATE UNIQUE INDEX "Booking_billId_key" ON "Booking"("billId"); - --- CreateIndex -CREATE INDEX "uuid_1" ON "Booking"("uuid"); - --- CreateIndex -CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); - --- CreateIndex -CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); - --- CreateIndex -CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token"); - --- CreateIndex -CREATE UNIQUE INDEX "_AdditionalCostsToBill_AB_unique" ON "_AdditionalCostsToBill"("A", "B"); - --- CreateIndex -CREATE INDEX "_AdditionalCostsToBill_B_index" ON "_AdditionalCostsToBill"("B"); - --- AddForeignKey -ALTER TABLE "Booking" ADD CONSTRAINT "Booking_billId_fkey" FOREIGN KEY ("billId") REFERENCES "Bill"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_AdditionalCostsToBill" ADD CONSTRAINT "_AdditionalCostsToBill_A_fkey" FOREIGN KEY ("A") REFERENCES "AdditionalCosts"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_AdditionalCostsToBill" ADD CONSTRAINT "_AdditionalCostsToBill_B_fkey" FOREIGN KEY ("B") REFERENCES "Bill"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20221011095300_bill_optional/migration.sql b/prisma/migrations/20221011095300_bill_optional/migration.sql deleted file mode 100644 index 4971b8c..0000000 --- a/prisma/migrations/20221011095300_bill_optional/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Booking" ALTER COLUMN "billId" DROP NOT NULL; diff --git a/prisma/migrations/20221011210633_update_some_shit/migration.sql b/prisma/migrations/20221011210633_update_some_shit/migration.sql deleted file mode 100644 index a7b21e6..0000000 --- a/prisma/migrations/20221011210633_update_some_shit/migration.sql +++ /dev/null @@ -1,7 +0,0 @@ --- AlterTable -ALTER TABLE "Bill" ALTER COLUMN "createdAt" SET DATA TYPE TIMESTAMP(3), -ALTER COLUMN "updatedAt" SET DATA TYPE TIMESTAMP(3); - --- AlterTable -ALTER TABLE "Booking" ALTER COLUMN "createdAt" SET DATA TYPE TIMESTAMP(3), -ALTER COLUMN "updatedAt" SET DATA TYPE TIMESTAMP(3); diff --git a/prisma/migrations/20221012204442_change_relation/migration.sql b/prisma/migrations/20221012204442_change_relation/migration.sql deleted file mode 100644 index dc048b6..0000000 --- a/prisma/migrations/20221012204442_change_relation/migration.sql +++ /dev/null @@ -1,31 +0,0 @@ -/* - Warnings: - - - The primary key for the `Booking` table will be changed. If it partially fails, the table could be left without primary key constraint. - - You are about to drop the column `billId` on the `Booking` table. All the data in the column will be lost. - - The `id` column on the `Booking` table would be dropped and recreated. This will lead to data loss if there is data in the column. - - A unique constraint covering the columns `[bookingId]` on the table `Bill` will be added. If there are existing duplicate values, this will fail. - - Added the required column `bookingId` to the `Bill` table without a default value. This is not possible if the table is not empty. - -*/ --- DropForeignKey -ALTER TABLE "Booking" DROP CONSTRAINT "Booking_billId_fkey"; - --- DropIndex -DROP INDEX "Booking_billId_key"; - --- AlterTable -ALTER TABLE "Bill" ADD COLUMN "bookingId" INTEGER NOT NULL; - --- AlterTable -ALTER TABLE "Booking" DROP CONSTRAINT "Booking_pkey", -DROP COLUMN "billId", -DROP COLUMN "id", -ADD COLUMN "id" SERIAL NOT NULL, -ADD CONSTRAINT "Booking_pkey" PRIMARY KEY ("id"); - --- CreateIndex -CREATE UNIQUE INDEX "Bill_bookingId_key" ON "Bill"("bookingId"); - --- AddForeignKey -ALTER TABLE "Bill" ADD CONSTRAINT "Bill_bookingId_fkey" FOREIGN KEY ("bookingId") REFERENCES "Booking"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml deleted file mode 100644 index fbffa92..0000000 --- a/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file