Skip to content

Commit

Permalink
fix: missing DATABASE_URL (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-ehrlich authored Jul 19, 2022
1 parent fc6519f commit b6164d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/PR-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: PR-CI
on:
pull_request:
branches: ["*"]

jobs:
install-deps:
runs-on: ubuntu-latest
Expand All @@ -31,7 +31,6 @@ jobs:
if: steps.pnpm-cache.outputs.cache-hit != 'true'
- run: pnpm install


lint:
runs-on: ubuntu-latest
name: Run ESLint
Expand Down Expand Up @@ -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
8 changes: 7 additions & 1 deletion src/installers/envVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,11 @@ export const envVariablesInstaller: 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),
]);
};
3 changes: 1 addition & 2 deletions template/addons/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ generator client {

datasource db {
provider = "sqlite"
url = "file:./db.sqlite"
// url = env("DATABASE_URL")
url = env("DATABASE_URL")
}

model Example {
Expand Down
2 changes: 1 addition & 1 deletion template/base/.env-example
Original file line number Diff line number Diff line change
@@ -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=
Expand Down

0 comments on commit b6164d8

Please sign in to comment.