mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	fix migration script in case of not fully consistent database (missing note_contents for note). closes #717
This commit is contained in:
		
							parent
							
								
									38e7649ac3
								
							
						
					
					
						commit
						c8ba07a4ae
					
				@ -20,7 +20,7 @@ SELECT noteId, title, -1, isProtected, type, mime, hash, isDeleted, isErased, da
 | 
				
			|||||||
DROP TABLE notes;
 | 
					DROP TABLE notes;
 | 
				
			||||||
ALTER TABLE notes_mig RENAME TO notes;
 | 
					ALTER TABLE notes_mig RENAME TO notes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
UPDATE notes SET contentLength = (SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId);
 | 
					UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
 | 
					CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
 | 
				
			||||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
 | 
					CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user