mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
e11e57f1d8
The implementation uses / symbol as a nesting separator. I.e. tag/subtag is a nested tag, where tag is the parent tag and subtag is its child. Creating a tag named tag/subtag/subsubtag creates three tags, one for each level. The tags are associated using parent_id field. In the app, viewing notes with a tag will also show all notes that are associated with any of the tag's descendant tags (same for the note count). Deleting a tag will also delete all its descendant tags. In the desktop app the tags are shown nested just like the notebooks.
29 lines
659 B
JavaScript
29 lines
659 B
JavaScript
const BaseModel = require('lib/BaseModel.js');
|
|
|
|
const migrationScripts = {
|
|
20: require('lib/migrations/20.js'),
|
|
27: require('lib/migrations/27.js'),
|
|
31: require('lib/migrations/31.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;
|