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.

Prisma Migrate cannot reset the database when the user has insufficient privileges - this makes Prisma Migrate incompatible with some hosted cloud providers

See original GitHub issue

Problem

This is the current error message

Error: Database error: Error querying the database: db error: ERROR: must be owner of schema public
   0: migration_core::api::Reset
             at migration-engine/core/src/api.rs:232

Suggested solution

  • We could make it a “known error”
  • Improve the text, suggestion: The database's user privileges are insufficient, the user must be owner of the "public" schema

Additional context

The current error must be owner of schema public is not super helpful if you don’t know it’s about the user privileges and that the schema name is public.

So we could improve the message to make it clear to the users what the problem is.

In this case the solution is to grant the “owner” privileges to the db user.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
albertoperdomocommented, Feb 16, 2021

This feature is now live in 2.17.0 - https://github.com/prisma/prisma/releases/tag/2.17.0

For feedback, please post on https://github.com/prisma/prisma/issues/4531.

1reaction
Jolg42commented, Feb 2, 2021

We need to check what we can do for cases like Digital Ocean

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma Migrate limitations and known issues
Prisma Migrate generates SQL files that are specific to your provider. This means that you cannot use the same migration files for PostgreSQL...
Read more >
Migration troubleshooting in development - Prisma
This guide describes how to resolve issues with Prisma Migrate in a development environment, which often involves resetting your database.
Read more >
Prisma Migrate | Database, Schema, SQL Migration Tool
Prisma Migrate is a database migration tool available via the Prisma CLI that integrates with Prisma schema for data modeling.
Read more >
Developing with Prisma Migrate
Configure the shadow database · If you are developing against a locally hosted database, make sure your user has sufficient privileges · If...
Read more >
Adding Prisma Migrate to an existing project
Check out a copy of the repository with the new migration directory and the schema.prisma file · Run the following command to reset...
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