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
Error updating relation during schema apply #8443
Comments
LOG_LEVEL="trace" should already show all the SQL queries that are performed. I'll gladly take more suggestions for what other things would be useful to log in there 👍🏻 |
It apparently had some trouble reading the fields from that "footer_section_items_translations" in the schema information 🤔 Does that collection still exist in the database? Could you try manually clearing the schema cache by sending a POST to /utils/cache/clear (using an admin user) to check if it might've been the schema cache being outdated? |
Ahhhhhhh yes yes that does make sense. Thanks! |
Lovely! I think this is the last bug that prevents me from going on staging with the snapshot feature, can't wait! |
Preflight Checklist
Describe the Bug
Hey guys,
I have found a weird error when trying to apply a snapshot. What's worth mentioning is that I am working on top of an existing database that already has some migrations applied in it. I have created a snapshot out of it and now trying to apply it back.
The error that I was getting is this one:
Unfortunately, reproduction is hard to achieve, but here is some debug data I was able to get:
Since the issue happens in the alterType function, I've checked what's passed as a relation there and it seems to be an incorrect one, as I am only getting a partial data, which causes the exception:
Going a step backwards, I can see that the relation diff looks like this:
Here are some details of the schema.
Relation inside the snapshot:
Relation record in the database:
I was able to fix this by changing the reduce's default value to the relation itself inside of apply-snapshot, but not sure if that's the proper fix.
Btw, it's worth adding more trace logs in the snapshots process as it takes forever to investigate.
Let me know if I can provide other information.
The text was updated successfully, but these errors were encountered: