Support database upgrades in Database.open

This commit is contained in:
Daniel Gasienica 2018-04-03 11:36:48 -04:00
parent f50ac1c99e
commit 1e04083813
2 changed files with 27 additions and 7 deletions

View file

@ -147,8 +147,15 @@ const database = {
migrations,
};
exports.run = ({ Backbone } = {}) =>
runMigrations({ Backbone, database });
exports.run = ({ Backbone, databaseName } = {}) =>
runMigrations({
Backbone,
database: Object.assign(
{},
database,
isString(databaseName) ? { id: databaseName } : {}
),
});
exports.getDatabase = () => ({
name: database.id,