There is unfortunately no way to rename a store. You have to copy/delete all the records using something like:
// old store
var store1 = intMapStoreFactory.store('store1');
// new store
var store2 = intMapStoreFactory.store('store2');
await db.transaction((txn) async {
/// Read all records from store1 and write them to store2
var records = await store1.find(txn);
for (var record in records) {
await store2.record(record.key).put(txn, record.value);
// Delete existing record
await store1.record(record.key).delete(txn);
}
});
There is unfortunately no way to rename a store. You have to copy/delete all the records using something like: