1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Moved resource app-specific state to different table

This commit is contained in:
Laurent Cozic
2018-11-13 00:45:08 +00:00
parent 3a9948e528
commit 06091933e1
13 changed files with 871 additions and 733 deletions

View File

@ -482,7 +482,9 @@ class BaseModel {
static batchDelete(ids, options = null) {
if (!ids.length) return;
options = this.modOptions(options);
return this.db().exec('DELETE FROM ' + this.tableName() + ' WHERE id IN ("' + ids.join('","') + '")');
const idFieldName = options.idFieldName ? options.idFieldName : 'id';
const sql = 'DELETE FROM ' + this.tableName() + ' WHERE ' + idFieldName + ' IN ("' + ids.join('","') + '")';
return this.db().exec(sql);
}
static db() {
@ -508,6 +510,7 @@ BaseModel.typeEnum_ = [
['TYPE_MASTER_KEY', 9],
['TYPE_ITEM_CHANGE', 10],
['TYPE_NOTE_RESOURCE', 11],
['TYPE_RESOURCE_LOCAL_STATE', 12],
];
for (let i = 0; i < BaseModel.typeEnum_.length; i++) {