Introduce mandatary migration on startup, to minimum version
This commit is contained in:
parent
f38647dfa5
commit
02675312c5
5 changed files with 122 additions and 49 deletions
|
@ -256,7 +256,10 @@ async function removeAll() {
|
|||
// erase everything in the database
|
||||
}
|
||||
|
||||
async function getMessagesNeedingUpgrade(limit, { MessageCollection }) {
|
||||
async function getMessagesNeedingUpgrade(
|
||||
limit,
|
||||
{ MessageCollection, maxVersion = MessageType.CURRENT_SCHEMA_VERSION }
|
||||
) {
|
||||
const messages = new MessageCollection();
|
||||
|
||||
await deferredToPromise(
|
||||
|
@ -264,7 +267,7 @@ async function getMessagesNeedingUpgrade(limit, { MessageCollection }) {
|
|||
limit,
|
||||
index: {
|
||||
name: 'schemaVersion',
|
||||
upper: MessageType.CURRENT_SCHEMA_VERSION,
|
||||
upper: maxVersion,
|
||||
excludeUpper: true,
|
||||
order: 'desc',
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue