Migrate: Missing env variable error message

Created on 31 Mar 2020  路  2Comments  路  Source: prisma/migrate

Problem

Small thing after upgrading to beta:

  • When using the env variable as connection string and running e.g. npx prisma migrate save --experimental without the DATABASE_URL env variable provided, the error message I am getting is: Error: Unknown database type dummy: (this is actually the whole error message, no other context here)

I think this used to be a better error message back in the preview (something actually about the env variable missing).

Solution

Display a correct error that this env variable is missing.

bu2-confirmed kinbug

Most helpful comment

Here is my folder structure:

proj/
    prisma/
        schema.prisma
    .env
    src/

It seems that if I don't put the .env file in the prisma/ directory although i am running the prisma migrate save --experimental cmd from the root directory, its unable to recognize the environment vars.

I have to bypass this by including 2 .env files, unless there is a better way, I think this is not ideal.

All 2 comments

Here is my folder structure:

proj/
    prisma/
        schema.prisma
    .env
    src/

It seems that if I don't put the .env file in the prisma/ directory although i am running the prisma migrate save --experimental cmd from the root directory, its unable to recognize the environment vars.

I have to bypass this by including 2 .env files, unless there is a better way, I think this is not ideal.

Thanks a lot for reporting 馃檹
This issue is fixed in the latest alpha version of @prisma/cli.
You can try it out with npm i -g @prisma/cli@alpha.

In case it鈥檚 not fixed for you - please let us know and we鈥檒l reopen this issue!

Was this page helpful?
0 / 5 - 0 ratings