mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	attribute sync fixes
This commit is contained in:
		
							parent
							
								
									359ff58be8
								
							
						
					
					
						commit
						45a92313d5
					
				| @ -80,7 +80,18 @@ async function getHashes() { | |||||||
|             date_modified, |             date_modified, | ||||||
|             date_created |             date_created | ||||||
|           FROM images   |           FROM images   | ||||||
|           ORDER BY image_id`))
 |           ORDER BY image_id`)),
 | ||||||
|  | 
 | ||||||
|  |         attributes: getHash(await sql.getAll(` | ||||||
|  |           SELECT  | ||||||
|  |             attribute_id, | ||||||
|  |             note_id | ||||||
|  |             name, | ||||||
|  |             value | ||||||
|  |             date_modified, | ||||||
|  |             date_created | ||||||
|  |           FROM attributes   | ||||||
|  |           ORDER BY attribute_id`))
 | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     const elapseTimeMs = new Date().getTime() - startTime.getTime(); |     const elapseTimeMs = new Date().getTime() - startTime.getTime(); | ||||||
|  | |||||||
| @ -124,11 +124,11 @@ async function updateNoteImage(entity, sourceId) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async function updateAttribute(entity, sourceId) { | async function updateAttribute(entity, sourceId) { | ||||||
|     const origAttribute = await sql.getFirst("SELECT * FROM attribute WHERE attribute_id = ?", [entity.attribute_id]); |     const origAttribute = await sql.getFirst("SELECT * FROM attributes WHERE attribute_id = ?", [entity.attribute_id]); | ||||||
| 
 | 
 | ||||||
|     if (!origAttribute || origAttribute.date_modified <= entity.date_modified) { |     if (!origAttribute || origAttribute.date_modified <= entity.date_modified) { | ||||||
|         await sql.doInTransaction(async () => { |         await sql.doInTransaction(async () => { | ||||||
|             await sql.replace("attribute", entity); |             await sql.replace("attributes", entity); | ||||||
| 
 | 
 | ||||||
|             await sync_table.addAttributeSync(entity.attribute_id, sourceId); |             await sync_table.addAttributeSync(entity.attribute_id, sourceId); | ||||||
|         }); |         }); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner