1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

Improved handling of multiple sync targets

This commit is contained in:
Laurent Cozic
2017-07-16 13:53:59 +01:00
parent cd6d8ce284
commit 24f61177d1
21 changed files with 206 additions and 121 deletions

View File

@@ -49,8 +49,14 @@ class BaseModel {
return fields.indexOf(name) >= 0;
}
static fieldNames() {
return this.db().tableFieldNames(this.tableName());
static fieldNames(withPrefix = false) {
let output = this.db().tableFieldNames(this.tableName());
if (!withPrefix) return output;
let temp = [];
for (let i = 0; i < output.length; i++) {
temp.push(this.tableName() + '.' + output[i]);
}
return temp;
}
static fieldType(name) {
@@ -228,6 +234,10 @@ class BaseModel {
queries.push(saveQuery);
if (options.nextQueries && options.nextQueries.length) {
queries = queries.concat(options.nextQueries);
}
return this.db().transactionExecBatch(queries).then(() => {
o = Object.assign({}, o);
o.id = modelId;