Watermelondb: Add backward compatible migrations for database schema changes

Created on 24 Sep 2018  路  5Comments  路  Source: Nozbe/WatermelonDB

First, thank you for such promising tool. I'm considering to use WatermelonDB in react-native app. For me that's will be enough possibility to recreate local database from scratch. As I see now the easiest way is to create new db and drop old one. So, as I understand for creating we can just change db name? Is there some possibility to drop old db?

WIP

Most helpful comment

As I see now the easiest way is to create new db and drop old one.

Right, currently the only way to migrate is to create a new database (you can make a new SQLiteAdapter with a different database name) and manually move the data.

Is there some possibility to drop old db?

Not currently.


Real migrations are coming soon. This is something I'll be working on this week and in the coming weeks. I know that this is very crucial for anyone who wants to use Watermelon in production.

All 5 comments

As I see now the easiest way is to create new db and drop old one.

Right, currently the only way to migrate is to create a new database (you can make a new SQLiteAdapter with a different database name) and manually move the data.

Is there some possibility to drop old db?

Not currently.


Real migrations are coming soon. This is something I'll be working on this week and in the coming weeks. I know that this is very crucial for anyone who wants to use Watermelon in production.

@ymahnovskyy I'm working on this now. Check out https://github.com/Nozbe/WatermelonDB/pull/62 and let me know if this basic API would satisfy your needs

@radex seen the commits from yesterday, and the progress looks amazing. I'm also think this tool looks really promising, and I'm much interested in specifically this feature.

thanks @febeling !

shipped

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebastian-schlecht picture sebastian-schlecht  路  8Comments

roots-ai picture roots-ai  路  4Comments

jdnichollsc picture jdnichollsc  路  4Comments

ScreamZ picture ScreamZ  路  8Comments

impactcolor picture impactcolor  路  4Comments