added hash columns for faster sync check calculation

This commit is contained in:
azivner
2018-05-22 00:15:54 -04:00
parent 9fa6c0918c
commit 49a53f7a45
13 changed files with 61 additions and 102 deletions

View File

@@ -14,6 +14,14 @@ class Entity {
if (!this[this.constructor.primaryKeyName]) {
this[this.constructor.primaryKeyName] = utils.newEntityId();
}
let contentToHash = "";
for (const propertyName of this.constructor.syncedProperties) {
contentToHash += "|" + this[propertyName];
}
this["hash"] = utils.hash(contentToHash).substr(0, 10);
}
async save() {