fixed initial demo import

This commit is contained in:
zadam
2020-07-02 21:08:18 +02:00
parent ef847b9904
commit c4cc48dfc9
5 changed files with 27 additions and 23 deletions

View File

@@ -99,17 +99,19 @@ function fillSyncRows(entityName, entityPrimaryKey, condition = '') {
}
function fillAllSyncRows() {
sql.execute("DELETE FROM sync");
sql.transactional(() => {
sql.execute("DELETE FROM sync");
fillSyncRows("notes", "noteId");
fillSyncRows("note_contents", "noteId");
fillSyncRows("branches", "branchId");
fillSyncRows("note_revisions", "noteRevisionId");
fillSyncRows("note_revision_contents", "noteRevisionId");
fillSyncRows("recent_notes", "noteId");
fillSyncRows("attributes", "attributeId");
fillSyncRows("api_tokens", "apiTokenId");
fillSyncRows("options", "name", 'isSynced = 1');
fillSyncRows("notes", "noteId");
fillSyncRows("note_contents", "noteId");
fillSyncRows("branches", "branchId");
fillSyncRows("note_revisions", "noteRevisionId");
fillSyncRows("note_revision_contents", "noteRevisionId");
fillSyncRows("recent_notes", "noteId");
fillSyncRows("attributes", "attributeId");
fillSyncRows("api_tokens", "apiTokenId");
fillSyncRows("options", "name", 'isSynced = 1');
});
}
module.exports = {