anote-server-libs 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,7 +78,7 @@ END`)
|
|
|
78
78
|
while (highestCommon < migrations.length && highestCommon < migrationsAvailable.length
|
|
79
79
|
&& migrations[highestCommon].hash === migrationsAvailable[highestCommon].hash)
|
|
80
80
|
highestCommon++;
|
|
81
|
-
this.applyDownUntil(migrations, migrations.length, highestCommon).then(
|
|
81
|
+
this.applyDownUntil(migrations, migrations.length, highestCommon).then(highestCommon => {
|
|
82
82
|
this.applyUpUntil(migrationsAvailable, Math.min(highestCommon, migrations.length), migrationsAvailable.length).then(callback, process.exit);
|
|
83
83
|
}, process.exit);
|
|
84
84
|
});
|
|
@@ -128,7 +128,7 @@ END`)
|
|
|
128
128
|
current--;
|
|
129
129
|
return this.applyDown(migrations[current]).then(() => this.applyDownUntil(migrations, current, until));
|
|
130
130
|
}
|
|
131
|
-
return Promise.resolve();
|
|
131
|
+
return Promise.resolve(current);
|
|
132
132
|
}
|
|
133
133
|
applyDown(migration) {
|
|
134
134
|
return new Promise((resolve, reject) => {
|
|
@@ -78,7 +78,7 @@ END`)])).then(() => {
|
|
|
78
78
|
while(highestCommon < migrations.length && highestCommon < migrationsAvailable.length
|
|
79
79
|
&& migrations[highestCommon].hash === migrationsAvailable[highestCommon].hash)
|
|
80
80
|
highestCommon++;
|
|
81
|
-
this.applyDownUntil(migrations, migrations.length, highestCommon).then(
|
|
81
|
+
this.applyDownUntil(migrations, migrations.length, highestCommon).then(highestCommon => {
|
|
82
82
|
this.applyUpUntil(migrationsAvailable, Math.min(highestCommon, migrations.length), migrationsAvailable.length).then(callback, process.exit);
|
|
83
83
|
}, process.exit);
|
|
84
84
|
});
|
|
@@ -124,12 +124,12 @@ END`)])).then(() => {
|
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
private applyDownUntil(migrations: Migration[], current: number, until: number): Promise<
|
|
127
|
+
private applyDownUntil(migrations: Migration[], current: number, until: number): Promise<number> {
|
|
128
128
|
if(current > until && !migrations[current - 1]?.skip) {
|
|
129
129
|
current--;
|
|
130
130
|
return this.applyDown(migrations[current]).then(() => this.applyDownUntil(migrations, current, until));
|
|
131
131
|
}
|
|
132
|
-
return Promise.resolve();
|
|
132
|
+
return Promise.resolve(current);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
private applyDown(migration: Migration): Promise<void> {
|