question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQL Server: `migrate dev` (and `db push`) does not create a database

See original GitHub issue

This 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:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
Jolg42commented, Aug 5, 2021
1reaction
tomhoulecommented, Jul 9, 2021

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found