Closed janpio closed 4 years ago
Interesting: Ctrl + C also does not let me exit the process, just goes from migration-engine.exe
back to node.exe
.
Same happens when I try to do this for a MySQL connection string and for other schemas.
For MySQL I can move forward when running the command again - then the database is recognized as existing and the migration is created or executed.
I am unable to reproduce this on Mac even with alpha.720
I also tried with MySQL and it also succeded.
You are aware I am using Windows.
Another report: https://github.com/prisma/migrate/issues/316#issuecomment-583743511
Yeah, I just posted my findings, it was on my list of stuff to try out on windows.
I can confirm this on windows.
It just hangs and I also can't stop the process using Ctrl + C
Any update on this? It still happens to me.
I'm running into the same problem with Postgres, does anyone have any temporary solution to this?
Kill the process with Ctrl+C, then run the command again. Second time the DB will exist and it should work.
Same issue here on Windows and MySQL. It seems that _migration
table is deleted everytime I try a migration. And when I Ctrl + C it miraculously create all tables (except for _migration) and I not able to migrate again because it tries to redo the whole migration but say that my tables has already been created (obviously)
@janpio Confirming that we are seeing more incoming reports of this for Windows users running RedwoodJS. See Issue https://github.com/redwoodjs/redwood/issues/575
Hard to debug as there's no console output during the hang. But please let us know if there's anything we could do to help pin this down. Happy to do so!
Reytring initial schema leads to:
C:\Users\Jan\Documents\throwaway\migrate342>npx prisma migrate save --experimental
Environment variables loaded from prisma\.env
Error: Get config {"is_panic":false,"message":"error: Error validating datasource `db`: The URL for datasource `db` must start with the protocol `sqlite://`.\n --> schema.prisma:3\n | \n 2 | provider = \"sqlite\"\n 3 | url = \"sqlite:dev.db\"\n | \n\nValidation Error Count: 1","meta":{"full_error":"error: Error validating datasource `db`: The URL for datasource `db` must start with the protocol `sqlite://`.\n --> schema.prisma:3\n | \n 2 | provider = \"sqlite\"\n 3 | url = \"sqlite:dev.db\"\n | \n\nValidation Error Count: 1"},"error_code":"P1012"}
When that is changed to url = "sqlite://dev.db"
as the error message indicates I get this:
C:\Users\Jan\Documents\throwaway\migrate342>npx prisma migrate save --experimental
Environment variables loaded from prisma\.env
? You are trying to create a migration for Sqlite database undefined.
A database with that name doesn't exist at sqlite://dev.db
» - Use arrow-keys. Return to submit.
> Yes - Create new Sqlite database undefined
No
Upon selecting this I get the following error:
C:\Users\Jan\Documents\throwaway\migrate342>npx prisma migrate save --experimental
Environment variables loaded from prisma\.env
√ You are trying to create a migration for Sqlite database undefined.
A database with that name doesn't exist at sqlite://dev.db
» Yes
Error: Command failed with exit code 255: C:\Users\Jan\Documents\throwaway\migrate342\node_modules\@prisma\cli\migration-engine-windows.exe cli --datasource sqlite://dev.db create-database
Jul 03 20:05:01.686 INFO migration_engine: Starting migration engine CLI git_hash="ed51c9476579e3aa52ec43079fb2a351c70f5bb7"
Jul 03 20:05:01.693 ERROR migration_engine::commands: Error querying the database: Error querying the database: unable to open database: //dev.db
{"is_panic":false,"message":"Error querying the database: Error querying the database: unable to open database: //dev.db\n","backtrace":null}
Same result with sqlite://./dev.db
.
With file:./dev.db
I get further:
C:\Users\Jan\Documents\throwaway\migrate342>npx prisma migrate save --experimental
Environment variables loaded from prisma\.env
√ You are trying to create a migration for Sqlite database /dev.db.
A database with that name doesn't exist at file:./dev.db
» Yes
error: Error validating model "sample_temperature_measurement": The unique index definition refers to the relation fields sample_id, temperature_measurement_id. Index definitions must reference only scalar fields.
--> schema.prisma:63
|
62 |
63 | @@unique([sample_id, temperature_measurement_id], name: "sample_temperature_measuremen_sample_id_temperature_measure_key")
|
We successfully received the error report
To help us even more, please create an issue at https://github.com/prisma/prisma/issues/new
mentioning the report id 8476.
Thanks a lot for your help! �🙏
and a database is indeed created.
So I think the initial error here is indeed fixed, but we have a bunch of bugs @Jolg42
Ok thanks! Will check this for sure 👍
Same result with
sqlite://./dev.db
.
Related https://github.com/prisma/prisma/issues/2941
The rest is fixed ✅
Create a
schema.prisma
with the following content:(modified from https://github.com/prisma/prisma/issues/1410)
Then run
prisma migrate save --experimental
. It asks me if I want to create the DB, which I answer "Yes". Then it creates the file but then just hangs and never finishes.