1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

All: Save size of a resource to the database; and added mechanism to run non-database migrations

This commit is contained in:
Laurent Cozic
2019-05-11 17:55:40 +01:00
parent e96bc9c48a
commit 9c85bc2cd1
11 changed files with 128 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
const BaseModel = require('lib/BaseModel.js');
const migrationScripts = {
20: require('lib/migrations/20.js'),
};
class Migration extends BaseModel {
static tableName() {
return 'migrations';
}
static modelType() {
return BaseModel.TYPE_MIGRATION;
}
static migrationsToDo() {
return this.modelSelectAll('SELECT * FROM migrations ORDER BY number ASC');
}
static script(number) {
return migrationScripts[number];
}
}
module.exports = Migration;