Skip to content

Commit a249bbb

Browse files
committed
Refine unallocated item request schema
1 parent 54ede41 commit a249bbb

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `itemId` on the `UnallocatedItemRequest` table. All the data in the column will be lost.
5+
- Added the required column `category` to the `UnallocatedItemRequest` table without a default value. This is not possible if the table is not empty.
6+
- Added the required column `title` to the `UnallocatedItemRequest` table without a default value. This is not possible if the table is not empty.
7+
- Added the required column `unitSize` to the `UnallocatedItemRequest` table without a default value. This is not possible if the table is not empty.
8+
9+
*/
10+
-- DropForeignKey
11+
ALTER TABLE "UnallocatedItemRequest" DROP CONSTRAINT "UnallocatedItemRequest_itemId_fkey";
12+
13+
-- AlterTable
14+
ALTER TABLE "UnallocatedItemRequest" DROP COLUMN "itemId",
15+
ADD COLUMN "category" TEXT NOT NULL,
16+
ADD COLUMN "expirationDate" TIMESTAMP(3),
17+
ADD COLUMN "title" TEXT NOT NULL,
18+
ADD COLUMN "unitSize" INTEGER NOT NULL;

prisma/schema.prisma

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ model Item {
5858
maxRequestLimit String
5959
6060
visible Boolean
61-
62-
unallocatedItemRequests UnallocatedItemRequest[]
6361
}
6462

6563
model UnallocatedItemRequest {
@@ -69,8 +67,10 @@ model UnallocatedItemRequest {
6967
partner User @relation(fields: [partnerId], references: [id], onDelete: Cascade)
7068
partnerId Int
7169
72-
item Item @relation(fields: [itemId], references: [id], onDelete: Cascade)
73-
itemId Int
70+
title String
71+
category String
72+
expirationDate DateTime?
73+
unitSize Int
7474
7575
quantity Int
7676
comments String

0 commit comments

Comments
 (0)