mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-02 19:36:12 +01:00 
			
		
		
		
	import of initial demo document sets sync.isSynced incorrectly to always 0, #1163
This commit is contained in:
		
							
								
								
									
										4
									
								
								db/migrations/0159__fix_isSynced_in_sync_rows.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								db/migrations/0159__fix_isSynced_in_sync_rows.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					UPDATE sync SET isSynced = 1 WHERE entityName != 'options' OR (
 | 
				
			||||||
 | 
					        entityName = 'options'
 | 
				
			||||||
 | 
					        AND 1 = (SELECT isSynced FROM options WHERE name = sync.entityId)
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
@@ -4,7 +4,7 @@ const build = require('./build');
 | 
				
			|||||||
const packageJson = require('../../package');
 | 
					const packageJson = require('../../package');
 | 
				
			||||||
const {TRILIUM_DATA_DIR} = require('./data_dir');
 | 
					const {TRILIUM_DATA_DIR} = require('./data_dir');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const APP_DB_VERSION = 158;
 | 
					const APP_DB_VERSION = 159;
 | 
				
			||||||
const SYNC_VERSION = 14;
 | 
					const SYNC_VERSION = 14;
 | 
				
			||||||
const CLIPPER_PROTOCOL_VERSION = "1.0";
 | 
					const CLIPPER_PROTOCOL_VERSION = "1.0";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -16,4 +16,4 @@ module.exports = {
 | 
				
			|||||||
    buildRevision: build.buildRevision,
 | 
					    buildRevision: build.buildRevision,
 | 
				
			||||||
    dataDirectory: TRILIUM_DATA_DIR,
 | 
					    dataDirectory: TRILIUM_DATA_DIR,
 | 
				
			||||||
    clipperProtocolVersion: CLIPPER_PROTOCOL_VERSION
 | 
					    clipperProtocolVersion: CLIPPER_PROTOCOL_VERSION
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,7 +82,8 @@ async function fillSyncRows(entityName, entityPrimaryKey, condition = '') {
 | 
				
			|||||||
                    entityName: entityName,
 | 
					                    entityName: entityName,
 | 
				
			||||||
                    entityId: entityId,
 | 
					                    entityId: entityId,
 | 
				
			||||||
                    sourceId: "SYNC_FILL",
 | 
					                    sourceId: "SYNC_FILL",
 | 
				
			||||||
                    utcSyncDate: dateUtils.utcNowDateTime()
 | 
					                    utcSyncDate: dateUtils.utcNowDateTime(),
 | 
				
			||||||
 | 
					                    isSynced: true
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -127,4 +128,4 @@ module.exports = {
 | 
				
			|||||||
    fillAllSyncRows,
 | 
					    fillAllSyncRows,
 | 
				
			||||||
    addEntitySyncsForSector,
 | 
					    addEntitySyncsForSector,
 | 
				
			||||||
    getMaxSyncId: () => maxSyncId
 | 
					    getMaxSyncId: () => maxSyncId
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user