Skip to content

Commit

Permalink
Merge pull request #3181 from serlo/3179-update-prisma-setup-for-work…
Browse files Browse the repository at this point in the history
…spaces

add prisma commands to workspace
  • Loading branch information
Entkenntnis authored Dec 7, 2023
2 parents 84103ad + 66395e9 commit 6ec277f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Some of the features we use:

We are trying out a [serverless sql database](https://app.planetscale.com/serlo/serlo_planetscale) and use it to build prototypes. Don't use for production features yet!

Add the environment variable `DATABASE_URL` to `.env.local` (next.js) and `prisma/.env` (prisma cli). You can generate the database url from planetscale or ping one of us to generat one for you. (sorry for the inconvienience here). Run `yarn prisma generate` to update the prisma client and test the database connection.
Add the environment variable `DATABASE_URL` to `apps/web/.env.local` (next.js). You can generate the database url from planetscale or ping one of us to generat one for you. (sorry for the inconvienience here). Run `yarn prisma:build` to update the prisma client and test the database connection. Run `yarn prisma:studio` for Prisma Studio, run `yarn prisma:db-pull` to download db schema.

## Repository Overview

Expand Down
4 changes: 1 addition & 3 deletions apps/web/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ model QuickbarStats {

model EquationsAppStats {
id Int @id @default(autoincrement())
event String @db.VarChar(255)
latex String @db.VarChar(255)
sessionId String @db.VarChar(64)
timestamp DateTime @default(now())
@@index([timestamp])
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
"lint:eslint": "yarn workspace @serlo/frontend lint:eslint",
"lint:prettier": "yarn workspace @serlo/frontend lint:prettier",
"lint:tsc": "yarn workspace @serlo/frontend lint:tsc",
"prisma:db-pull": "dotenv -e apps/web/.env.local yarn workspace @serlo/frontend prisma db pull",
"prisma:studio": "dotenv -e apps/web/.env.local yarn workspace @serlo/frontend prisma studio",
"start": "yarn workspace @serlo/frontend start",
"test": "yarn workspace @serlo/frontend test"
},
"devDependencies": {
"dotenv-cli": "^7.3.0",
"prettier": "^3.1.0",
"prettier-plugin-packagejson": "^2.4.6"
},
Expand Down
24 changes: 23 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4239,6 +4239,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@serlo/monorepo@workspace:."
dependencies:
dotenv-cli: ^7.3.0
prettier: ^3.1.0
prettier-plugin-packagejson: ^2.4.6
languageName: unknown
Expand Down Expand Up @@ -7227,7 +7228,28 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:^16.0.0, dotenv@npm:^16.3.1":
"dotenv-cli@npm:^7.3.0":
version: 7.3.0
resolution: "dotenv-cli@npm:7.3.0"
dependencies:
cross-spawn: ^7.0.3
dotenv: ^16.3.0
dotenv-expand: ^10.0.0
minimist: ^1.2.6
bin:
dotenv: cli.js
checksum: bc48e9872ed451aa7633cfde0079f5e4b40837d49dca4eab947682c80f524bd1e63ec31ff69b7cf955ff969185a05a343dd5d754dd5569e4ae31f8e9a790ab1b
languageName: node
linkType: hard

"dotenv-expand@npm:^10.0.0":
version: 10.0.0
resolution: "dotenv-expand@npm:10.0.0"
checksum: 2a38b470efe0abcb1ac8490421a55e1d764dc9440fd220942bce40965074f3fb00b585f4346020cb0f0f219966ee6b4ee5023458b3e2953fe5b3214de1b314ee
languageName: node
linkType: hard

"dotenv@npm:^16.0.0, dotenv@npm:^16.3.0, dotenv@npm:^16.3.1":
version: 16.3.1
resolution: "dotenv@npm:16.3.1"
checksum: 15d75e7279018f4bafd0ee9706593dd14455ddb71b3bcba9c52574460b7ccaf67d5cf8b2c08a5af1a9da6db36c956a04a1192b101ee102a3e0cf8817bbcf3dfd
Expand Down

0 comments on commit 6ec277f

Please sign in to comment.