1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Make sure resource filesize is set in all cases

This commit is contained in:
Laurent Cozic
2019-05-12 11:41:07 +01:00
parent ed3970be81
commit e1b7b64e1b
10 changed files with 66 additions and 9 deletions

View File

@ -14,16 +14,19 @@ class MigrationService extends BaseService {
return this.instance_;
}
async runScript(num) {
const script = Migration.script(num);
await script.exec();
}
async run() {
const migrations = await Migration.migrationsToDo();
for (const migration of migrations) {
this.logger().info('Running migration: ' + migration.number);
const script = Migration.script(migration.number);
try {
await script.exec();
await this.runScript(migration.number);
await Migration.delete(migration.id);
} catch (error) {
this.logger().error('Cannot run migration: ' + migration.number, error);