SQL Server: `migrate dev` (and `db push`) does not create a database
See original GitHub issueThis is the error message when you try to migrate a database that does not exist on SQL Server:
C:\Users\Jan\Documents\throwaway\sqlServerCycles>npx prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db" - SQL Server
Error: Migration engine error:
Performing a TLS handshake
Trusting the server certificate without validation.
TLS handshake successful
Turning TLS off after a login. All traffic from here on is not encrypted.
Cannot open database "mydb" requested by the login. The login failed.
Database error
Database does not exist: mydb
(We should probably have tests for all databases that ensure this works)
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Prisma Migrate: Error creating shadow database #4571 - GitHub
Problem. Users run into this issue if their database user has no privileges to create databases (MySQL / Postgres). This happens because Migrate...
Read more >Error when migrating models to database Prisma
I tried Introspect. But, my DB currently has no tables and that threw an error. I tried npx prisma migrate save -experimental b/c...
Read more >Prototype your schema - Prisma
Use db push to prototype a change to an existing schema, then run prisma migrate dev to generate a migration from your changes...
Read more >Migrate an Access database to SQL Server - Microsoft Support
Microsoft provides Microsoft SQL Server Migration Assistant (SSMA) to make migration easier. SSMA mainly migrates tables and select queries with no parameters.
Read more >Automatic Prisma migrations - PlanetScale
We recommend prisma db push over prisma migrate dev for the ... created a new PlanetScale database and the main branch has not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should be fixed when https://github.com/prisma/prisma-engines/pull/2133 drops
I did some testing in the context of https://github.com/prisma/prisma-engines/pull/2089 and the ME does try to create a database on
create-database
and returns a proper error when that happens. Maybe there is something in the CLI preventing that code from running?