Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - Migrate: When Drift Detected -> give more Details than just the rollback script #5873

Closed
Jolg42 opened this issue Feb 26, 2021 · 7 comments · Fixed by prisma/prisma-engines#2002
Assignees
Labels
kind/improvement An improvement to existing feature and code. team/schema Issue for team Schema. tech/engines/migration engine Issue in the Migration Engine topic: migrate
Milestone

Comments

@Jolg42
Copy link
Member

Jolg42 commented Feb 26, 2021

Problem

The CLI reports some "Drift", it's not clear what it is.

Suggested solution

Provide more insight about the drift detected. Is it a column property, or entire tables that are missing?

@Jolg42 Jolg42 added kind/improvement An improvement to existing feature and code. topic: migrate tech/engines/migration engine Issue in the Migration Engine team/schema Issue for team Schema. labels Feb 26, 2021
@janpio
Copy link
Member

janpio commented Apr 8, 2021

Example from internal discussion: https://prisma-company.slack.com/archives/CGMCB82N8/p1617885743151100

@tomhoule
Copy link
Contributor

Scheduling this for this cycle to come up with a proposal, along with related issue: https://github.com/prisma/migrations-team/issues/223

@albertoperdomo
Copy link
Contributor

In the Slack thread commented above, the motivation to understand drift is for troubleshooting. The user had added a table and it was unclear to him/her, why Prisma Migrate was reporting any drift.

There are different ways this drift could be surfaced:

  • abstracted: a summary of the diff, e.g. tables/columns missing, unexpected tables/columns found, difference in expected types or default values.
  • detailed: a DDL script describing the changes that would required to remove the drift.

@tomhoule tomhoule removed this from the 2.22.0 milestone May 5, 2021
@tomhoule tomhoule added this to the 2.24.0 milestone May 19, 2021
@deloreanz
Copy link

This is pretty crucial for feedback on how to resolve the issue manually. A step further could be an option to generate a migration to get the database back in line with the Prisma schema, but currently I'd be delighted just to be able to see the detected drift.

@deloreanz
Copy link

Prisma is still detecting a drift despite the fact that my Postgres structural diff detects no changes. Hopefully when more verbose detected drift feedback is available it can list exactly what it doesn't like, even when other compare tools see no diff.

@tomhoule
Copy link
Contributor

tomhoule commented Jun 9, 2021

prisma/prisma-engines#2002 means that the next release (and dev releases very soon) will have human-readable drift summaries. They will probably be a bit rough at the beginning, but we will improve them over time.

@Jolg42
Copy link
Member Author

Jolg42 commented Jun 15, 2021

You can now try 2.25.0 and let us know what you think 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. team/schema Issue for team Schema. tech/engines/migration engine Issue in the Migration Engine topic: migrate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants