From 6cf0b71c529d4af2c98beab89f0c34b2e7a9ec82 Mon Sep 17 00:00:00 2001 From: Christopher Ehrlich Date: Tue, 19 Jul 2022 12:54:18 +0200 Subject: [PATCH 1/2] fix: missing DATABASE_URL --- src/installers/envVars.ts | 8 +++++++- template/addons/prisma/schema.prisma | 3 +-- template/base/.env-example | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/installers/envVars.ts b/src/installers/envVars.ts index a7389d261a..3addf59f46 100644 --- a/src/installers/envVars.ts +++ b/src/installers/envVars.ts @@ -31,5 +31,11 @@ export const envVariblesInstaller: Installer = async ({ const envSchemaSrc = path.join(envAssetDir, envFile); const envSchemaDest = path.join(projectDir, "src/server/env-schema.mjs"); - await fs.copy(envSchemaSrc, envSchemaDest, { overwrite: true }); + const envExample = path.join(projectDir, ".env-example"); + const envDest = path.join(projectDir, ".env"); + + await Promise.all([ + fs.copy(envSchemaSrc, envSchemaDest, { overwrite: true }), + fs.rename(envExample, envDest), + ]); }; diff --git a/template/addons/prisma/schema.prisma b/template/addons/prisma/schema.prisma index 90cd79af9a..34ba4eb7d5 100644 --- a/template/addons/prisma/schema.prisma +++ b/template/addons/prisma/schema.prisma @@ -7,8 +7,7 @@ generator client { datasource db { provider = "sqlite" - url = "file:./db.sqlite" - // url = env("DATABASE_URL") + url = env("DATABASE_URL") } model Example { diff --git a/template/base/.env-example b/template/base/.env-example index 2a25fe514f..bc003984c4 100644 --- a/template/base/.env-example +++ b/template/base/.env-example @@ -1,7 +1,7 @@ # Note that not all variables here might be in use for your selected configuration # Prisma -DATABASE_URL=postgresql://postgres:@localhost:5832/db +DATABASE_URL=file:./db.sqlite # Next Auth NEXTAUTH_SECRET= From 99e936cf10217d105f1251c510293441b5e2b605 Mon Sep 17 00:00:00 2001 From: Christopher Ehrlich Date: Tue, 19 Jul 2022 13:03:45 +0200 Subject: [PATCH 2/2] fix: no longer need to rename .env-example in CI --- .github/workflows/PR-CI.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml index 24dd524032..bd0f252a59 100644 --- a/.github/workflows/PR-CI.yml +++ b/.github/workflows/PR-CI.yml @@ -5,7 +5,7 @@ name: PR-CI on: pull_request: branches: ["*"] - + jobs: install-deps: runs-on: ubuntu-latest @@ -31,7 +31,6 @@ jobs: if: steps.pnpm-cache.outputs.cache-hit != 'true' - run: pnpm install - lint: runs-on: ubuntu-latest name: Run ESLint @@ -125,5 +124,4 @@ jobs: # has to be scaffolded outside the CLI project so that no lint/tsconfig are leaking # through. this way it ensures that it is the app's configs that are being used - run: pnpm start -y ../ci-test-app - - run: mv ../ci-test-app/.env-example ../ci-test-app/.env - run: cd ../ci-test-app && pnpm build