trilium/src/routes/api/migration.js

25 lines
572 B
JavaScript
Raw Normal View History

2017-10-22 09:10:33 +08:00
"use strict";
const optionService = require('../../services/options');
const migrationService = require('../../services/migration');
const appInfo = require('../../services/app_info');
2017-10-16 05:31:49 +08:00
async function getMigrationInfo() {
return {
2018-04-03 09:47:46 +08:00
dbVersion: parseInt(await optionService.getOption('dbVersion')),
app_dbVersion: appInfo.dbVersion
};
}
2017-10-16 05:31:49 +08:00
async function executeMigration() {
const migrations = await migrationService.migrate();
2017-10-16 05:31:49 +08:00
return {
migrations: migrations
};
}
2017-10-16 05:31:49 +08:00
module.exports = {
getMigrationInfo,
executeMigration
};