Support database upgrades in Database.open
This commit is contained in:
parent
f50ac1c99e
commit
1e04083813
2 changed files with 27 additions and 7 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue