-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from coronasafe/fix-prisma-schema
resolve conflicts in prisma schema migrations
- Loading branch information
Showing
3 changed files
with
75 additions
and
44 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
prisma/migrations/20230619073305_ocr_fields_added/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- AlterTable | ||
ALTER TABLE "Asset" ADD COLUMN "password" TEXT, | ||
ADD COLUMN "port" INTEGER, | ||
ADD COLUMN "username" TEXT; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Bed" ( | ||
"id" SERIAL NOT NULL, | ||
"patientExternalId" TEXT NOT NULL, | ||
"x" INTEGER NOT NULL, | ||
"y" INTEGER NOT NULL, | ||
"zoom" INTEGER NOT NULL DEFAULT 0, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"deleted" BOOLEAN NOT NULL DEFAULT false, | ||
|
||
CONSTRAINT "Bed_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Bed_patientExternalId_key" ON "Bed"("patientExternalId"); |
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
prisma/migrations/20230825143954_alter_bed_and_asset/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `patientExternalId` on the `Bed` table. All the data in the column will be lost. | ||
- You are about to drop the column `x` on the `Bed` table. All the data in the column will be lost. | ||
- You are about to drop the column `y` on the `Bed` table. All the data in the column will be lost. | ||
- You are about to drop the column `zoom` on the `Bed` table. All the data in the column will be lost. | ||
- A unique constraint covering the columns `[externalId]` on the table `Bed` will be added. If there are existing duplicate values, this will fail. | ||
- Added the required column `cameraId` to the `Bed` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `externalId` to the `Bed` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `name` to the `Bed` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- CreateEnum | ||
CREATE TYPE "AssetType" AS ENUM ('CAMERA', 'MONITOR'); | ||
|
||
-- DropIndex | ||
DROP INDEX "Bed_patientExternalId_key"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Asset" ADD COLUMN "type" "AssetType" NOT NULL DEFAULT 'MONITOR', | ||
ALTER COLUMN "port" SET DEFAULT 80; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Bed" DROP COLUMN "patientExternalId", | ||
DROP COLUMN "x", | ||
DROP COLUMN "y", | ||
DROP COLUMN "zoom", | ||
ADD COLUMN "cameraId" INTEGER NOT NULL, | ||
ADD COLUMN "externalId" TEXT NOT NULL, | ||
ADD COLUMN "name" TEXT NOT NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Preset" ( | ||
"id" SERIAL NOT NULL, | ||
"x" INTEGER NOT NULL, | ||
"y" INTEGER NOT NULL, | ||
"zoom" INTEGER NOT NULL DEFAULT 0, | ||
"bedId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Preset_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Preset_bedId_key" ON "Preset"("bedId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Bed_externalId_key" ON "Bed"("externalId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Bed" ADD CONSTRAINT "Bed_cameraId_fkey" FOREIGN KEY ("cameraId") REFERENCES "Asset"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Preset" ADD CONSTRAINT "Preset_bedId_fkey" FOREIGN KEY ("bedId") REFERENCES "Bed"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |