You've already forked joplin
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:
27
ReactNativeClient/lib/models/Migration.js
Normal file
27
ReactNativeClient/lib/models/Migration.js
Normal 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;
|
||||
Reference in New Issue
Block a user