Skip to content

Commit 9150de4

Browse files
committed
#1523 - one migration
1 parent ac487a0 commit 9150de4

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/backend/src/prisma/migrations/20231116021507_manu_del_endpoint/migration.sql

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/backend/src/prisma/migrations/20231119054311_add_bom/migration.sql renamed to src/backend/src/prisma/migrations/20231119081007_add_bom/migration.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ CREATE TABLE "Manufacturer" (
6262
"name" TEXT NOT NULL,
6363
"dateCreated" TIMESTAMP(3) NOT NULL,
6464
"creatorId" INTEGER NOT NULL,
65+
"dateDeleted" TIMESTAMP(3),
66+
"deletedByUserId" INTEGER,
6567

6668
CONSTRAINT "Manufacturer_pkey" PRIMARY KEY ("name")
6769
);
@@ -98,3 +100,6 @@ ALTER TABLE "Material" ADD CONSTRAINT "Material_manufacturerName_fkey" FOREIGN K
98100

99101
-- AddForeignKey
100102
ALTER TABLE "Material" ADD CONSTRAINT "Material_unitName_fkey" FOREIGN KEY ("unitName") REFERENCES "Unit"("name") ON DELETE SET NULL ON UPDATE CASCADE;
103+
104+
-- AddForeignKey
105+
ALTER TABLE "Manufacturer" ADD CONSTRAINT "Manufacturer_deletedByUserId_fkey" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("userId") ON DELETE SET NULL ON UPDATE CASCADE;

src/backend/src/transformers/manufacturer.transformer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export const manufacturerTransformer = (
1212
return {
1313
name: manufacturer.name,
1414
dateCreated: manufacturer.dateCreated,
15-
creatorId: manufacturer.creatorId
15+
creatorId: manufacturer.creatorId,
16+
dateDeleted: manufacturer.dateDeleted,
17+
deletedByUserId: manufacturer.deletedByUserId
1618
};
1719
};

0 commit comments

Comments
 (0)