Skip to content

Commit 64f5b14

Browse files
committed
feat(generators/with-postgres-prisma): add pluralize module, fix prisma:db-push & :db-seed scripts, add model x db table name mapping
1 parent 3a915be commit 64f5b14

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

generators/with-postgres-prisma/templates/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
},
1313
"scripts": {
1414
"prisma": "node_modules/.bin/prisma",
15-
"prisma:db-push": "yarn prisma:db push --schema src/db/postgres.prisma --preview-feature",
16-
"prisma:db-seed": "yarn prisma:db seed --schema src/db/postgres.prisma --preview-feature",
15+
"prisma:db-push": "yarn prisma db push --schema src/db/postgres.prisma --preview-feature",
16+
"prisma:db-seed": "yarn prisma db seed --schema src/db/postgres.prisma --preview-feature",
1717
"prisma:generate": "yarn prisma generate --schema src/db/postgres.prisma",
1818
"prisma:generate-watch": "yarn prisma:generate --watch",
1919
"postinstall": "yarn prisma:generate",
@@ -39,6 +39,7 @@
3939
"express": "*",
4040
"http-status-codes": "*",
4141
"morgan": "*",
42+
"pluralize": "*",
4243
"source-map-support": "*",
4344
"yup": "*"
4445
},
@@ -48,6 +49,7 @@
4849
"@boringcodes/prettier-config": "*",
4950
"@types/express": "*",
5051
"@types/morgan": "*",
52+
"@types/pluralize": "*",
5153
"@types/yup": "*",
5254
"@typescript-eslint/eslint-plugin": "*",
5355
"@typescript-eslint/parser": "*",

generators/with-postgres-prisma/templates/src/db/postgres.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ generator client {
88
}
99

1010
model Thing {
11+
@@map(name: "things")
1112
id Int @id @default(autoincrement())
1213
name String?
1314
}

0 commit comments

Comments
 (0)