Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing DATABASE_URL #222

Merged
merged 4 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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