diff --git a/apps/api/package.json b/apps/api/package.json index faa28e5..c146766 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -17,6 +17,7 @@ "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json", + "db:generate": "npx prisma-multischema generate", "db:migrate": "npx prisma migrate dev", "db:deploy": "npx prisma migrate deploy", "console": "npm run start -- --watch --entryFile repl" @@ -59,6 +60,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