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

Make sure old style references are backwards compatible #780

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Aug 12, 2022

Some properties that used to be represented by a string 'xyz' are now represented by a { $$ref: 'xyz' }. This allows us to detect them in our data structure and treat them as their own datatype. There was no backwards compatibility put in place and we can't do migrations yet, so this will fix older apps that are now broken

@render
Copy link

render bot commented Aug 12, 2022

@oliviertassinari oliviertassinari requested a deployment to backwards-ref - toolpad-db PR #780 August 12, 2022 07:06 — with Render Abandoned
@Janpot Janpot marked this pull request as ready for review August 12, 2022 07:07
Copy link
Member

@bharatkashyap bharatkashyap left a comment

Choose a reason for hiding this comment

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

Makes sense

@Janpot Janpot merged commit 3ffcae8 into master Aug 12, 2022
@Janpot Janpot deleted the backwards-ref branch August 12, 2022 09:11
@bytasv
Copy link
Contributor

bytasv commented Aug 12, 2022

@Janpot I was wondering - would it make sense to tackle backwards compatibility / migrations problem a little bit more? I mean going forward I assume we will have more and more such cases where we want to tweak data structure. We could open a GH issue and maybe figure out if there is a pattern that we could reuse, or at least start gather info where we needed that so we can build a better picture 🤔

@Janpot
Copy link
Member Author

Janpot commented Aug 12, 2022

@bytasv yes, absolutely, it's becoming more and more a blocker as the app gets more complex. Datamodels that we started out with are becoming too simplistic for newer features. There is the following ticket #741
The idea is to version our application datamodel, and provide migrations upwards* for each version. then we'll migrate the model immediately when we load it from the db, so that the application will always work with the latest version and the whole worry about backwards compatibility is contained at a single point. This PR and a few other patches I made before are temporary until we can encode it in a migration.
@bharatkashyap Is starting an effort on that in #776

* We will not tackle down migrations for now as there are no concrete use cases yet. Users must always backup their database before attempting upgrading toolpad. In a farther future where apps are shareable between instances, it may become interesting to support a form of downwards migrations

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.

4 participants