drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: Ability to get info on migration status & if db can be migrated
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Describe what you want
For example - say you have a mostly if not entirely offline electron app (at the very least we cannot assume the user has an internet connection). This app stores some data in a SQLite db file. This file has some schema as defined in code. As the user updates the app and the schemas change new migrations are created and run.
Then let's say one day a new release comes out that has another schema change and migration - but this one also has a broken feature. The user launches the app, migration happens and some time later the use notices a feature they need is broken. So they install an older version of the app - but oh no! The older version of the app has and expects a different schema!
Now to prevent the loss of data and allow for storing new data we should create a new db file for that version specifically that the newer version will know how to run migrations on and merge data from. But how do we know if the schemas are not migratable?
It would be nice to be able to check what migration / schema version the current db file is on and if it is possible to migrate or if it will fail before trying and possibly breaking things or whatever. Please do let me know if there is already some way to check such things.
Contributor guide
Assessment
This issue has not been assessed yet.