database = Room.databaseBuilder(context.getApplicationContext(),
UsersDatabase.class, "Sample.db")
.fallbackToDestructiveMigration()
.build();
This will be useful when we use db for caching. Just need to bump up the schemaVersion and thats it. No need to write migrations.
I like this idea, it will be added in the next moor version.
You'll be able to use it like this:
@UseMoor(...)
class MyDatabase extends _$MyDatabase {
@override
MigrationStrategy get migration => destructiveFallback;
}
This doesn't necessarily work when you remove a trigger or a table (entity), because it is not listed in allSchemaEntities anymore. The existing entities before the update need to be determined from the sqlite_master itself or the previous schema version once something like https://github.com/simolus3/moor/issues/240 exists.
Most helpful comment
I like this idea, it will be added in the next moor version.
You'll be able to use it like this: