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

Overriding DATABASE_URL for migration example doesn't work #59

Open
garethlau opened this issue Oct 4, 2022 · 0 comments
Open

Overriding DATABASE_URL for migration example doesn't work #59

garethlau opened this issue Oct 4, 2022 · 0 comments

Comments

@garethlau
Copy link

Hey! I found this example from this page. I did as the docs suggested, adding an override to the DATABASE_URL environment variable in package.json. I couldn't get it to work so I tried this example repository and also found that it failed to run the migrations.

I cloned the data-proxy branch and added a .env file with two variables:

DATABASE_URL=prisma://<stuff>
MIGRATE_DATABASE_URL=postgresql://<stuff>

Then I ran yarn run prisma:migrate script and got the following error:

$ DATABASE_URL="$MIGRATE_DATABASE_URL" prisma migrate deploy
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Schema validation error - Error (query-engine-node-api library)
Error code: P1012
error: Error validating datasource `db`: You must provide a nonempty URL. The environment variable `DATABASE_URL` resolved to an empty string.
  -->  schema.prisma:7
   |
 6 |   provider = "postgresql"
 7 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
[Context: getConfig]

Prisma CLI Version : 4.4.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant