flamelink / flamelink-js-sdk

🦊 Official Flamelink JavaScript SDK for both the Firebase Realtime database and Cloud Firestore
https://flamelink.github.io/flamelink-js-sdk
MIT License
43 stars 5 forks source link

Question: How to support migrations #213

Open 0xPr0xy opened 7 months ago

0xPr0xy commented 7 months ago

Use case:

When adding or removing fields to or from the schema, there is no way to specify how this should affect existing content. Our case is even more difficult because the flame link content is partially copied over to other firestore documents.

I could write my own migration using your flamelink JS SDK, but I don't know if there is a good trigger I can use to be notified of schema changes and to then detect which fields have changed, so I can write for each of those fields a migration that will supply a value that can then be used on existing content for that schema.

I'd appreciate your thoughts on what the most elegant way to accomplish this is