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

me: Fix schema handling in migration persistence #3537

Merged
merged 1 commit into from Dec 22, 2022

Conversation

pimeys
Copy link
Contributor

@pimeys pimeys commented Dec 21, 2022

@pimeys pimeys added this to the 4.9.0 milestone Dec 21, 2022
@pimeys pimeys requested a review from a team as a code owner December 21, 2022 17:08
@pimeys pimeys force-pushed the me/fix-schema-handling-in-persistence branch 2 times, most recently from c7f3223 to 97fab90 Compare December 22, 2022 09:33
@@ -121,12 +121,10 @@ fn multi_schema_reset(mut api: TestApi) {
}}
"#, api.datasource_block_with(&[("schemas", r#"["felines", "rodents"]"#)])
};
api.schema_push(&prisma_schema)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was broken and we didn't realize it before. What happens:

  • We push the schema
  • We then apply migrations, which creates the persistence
  • The persistence cannot find the _prisma_migrations table
  • Before it was ok, but now we look into all the schemas given, so it finds the pushed tables but no migrations table
  • We error out.

What we should do is to use migrate, which creates the migrations table and allows us to continue.

@pimeys pimeys force-pushed the me/fix-schema-handling-in-persistence branch from 97fab90 to 5f882a5 Compare December 22, 2022 09:42
Copy link
Contributor

@eviefp eviefp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@pimeys pimeys force-pushed the me/fix-schema-handling-in-persistence branch from 5f882a5 to a11d4ff Compare December 22, 2022 09:56
@pimeys pimeys merged commit 37eb6ab into main Dec 22, 2022
@pimeys pimeys deleted the me/fix-schema-handling-in-persistence branch December 22, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross schema reference with foreign key not working in 4.7.0+
2 participants