diff --git a/.yarn/cache/dotenv-cli-npm-7.3.0-7b0ff066d1-bc48e9872e.zip b/.yarn/cache/dotenv-cli-npm-7.3.0-7b0ff066d1-bc48e9872e.zip new file mode 100644 index 0000000000..0e2230963e Binary files /dev/null and b/.yarn/cache/dotenv-cli-npm-7.3.0-7b0ff066d1-bc48e9872e.zip differ diff --git a/.yarn/cache/dotenv-expand-npm-10.0.0-fa5b032ad9-2a38b470ef.zip b/.yarn/cache/dotenv-expand-npm-10.0.0-fa5b032ad9-2a38b470ef.zip new file mode 100644 index 0000000000..5d6c73b84c Binary files /dev/null and b/.yarn/cache/dotenv-expand-npm-10.0.0-fa5b032ad9-2a38b470ef.zip differ diff --git a/README.md b/README.md index 87e992389a..7ece7d1d97 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/apps/web/prisma/schema.prisma b/apps/web/prisma/schema.prisma index 61abc3d638..3343ec4b9a 100644 --- a/apps/web/prisma/schema.prisma +++ b/apps/web/prisma/schema.prisma @@ -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]) -} \ No newline at end of file +} diff --git a/package.json b/package.json index a710bc3851..dc30394eea 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/yarn.lock b/yarn.lock index 24c927a51b..a5f393266d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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 @@ -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