From 4175559f4c8dc834abdc1b1cdcfe61472f753b3d Mon Sep 17 00:00:00 2001 From: Mathias Private Laptop Date: Tue, 9 Apr 2024 20:48:45 +0200 Subject: [PATCH] (feat): Enable having multiple schema files for prisma before https://github.com/prisma/prisma/issues/2377 is resolved through prisma-multischema --- apps/api/package.json | 1 + apps/api/{src/database => prisma}/prisma.service.ts | 0 apps/api/prisma/schema.prisma | 7 +++++++ apps/api/prisma/subschemas/movies.prisma | 6 ++++++ 4 files changed, 14 insertions(+) rename apps/api/{src/database => prisma}/prisma.service.ts (100%) create mode 100644 apps/api/prisma/schema.prisma create mode 100644 apps/api/prisma/subschemas/movies.prisma diff --git a/apps/api/package.json b/apps/api/package.json index 15e1195..6354273 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -73,6 +73,7 @@ "jest": "^29.7.0", "prettier": "^3.0.0", "prisma": "^5.11.0", + "prisma-multischema": "^1.1.4", "source-map-support": "^0.5.21", "supertest": "^6.3.3", "ts-jest": "^29.1.0", diff --git a/apps/api/src/database/prisma.service.ts b/apps/api/prisma/prisma.service.ts similarity index 100% rename from apps/api/src/database/prisma.service.ts rename to apps/api/prisma/prisma.service.ts diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma new file mode 100644 index 0000000..b14cf8f --- /dev/null +++ b/apps/api/prisma/schema.prisma @@ -0,0 +1,7 @@ +//🧩Don't Edit this file.✨Generated in Tue Apr 09 2024 20:47:08 GMT+0200 (Central European Summer Time)✨ +model Movie { + id Int @id @default(autoincrement()) + title String + director String + createdAt DateTime @default(now()) +} diff --git a/apps/api/prisma/subschemas/movies.prisma b/apps/api/prisma/subschemas/movies.prisma new file mode 100644 index 0000000..edd1709 --- /dev/null +++ b/apps/api/prisma/subschemas/movies.prisma @@ -0,0 +1,6 @@ +model Movie { + id Int @id @default(autoincrement()) + title String + director String + createdAt DateTime @default(now()) +} \ No newline at end of file