mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-15 09:04:04 +02:00
2a63ecef2a
* Started updating to use external renderer package * Added way to build renderer assets * Done mobile compatilibty * Upgrade joplin-renderer * Added joplin-renderer package
28 lines
621 B
JavaScript
28 lines
621 B
JavaScript
const BaseModel = require('lib/BaseModel.js');
|
|
|
|
const migrationScripts = {
|
|
20: require('lib/migrations/20.js'),
|
|
27: require('lib/migrations/27.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) {
|
|
if (!migrationScripts[number]) throw new Error('Migration script has not been added to "migrationScripts" array');
|
|
return migrationScripts[number];
|
|
}
|
|
}
|
|
|
|
module.exports = Migration;
|