mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 07:01:31 +08:00 
			
		
		
		
	migration for inconsistent isProtected status across notes and note_contents
This commit is contained in:
		
							parent
							
								
									4b41eddf44
								
							
						
					
					
						commit
						c240fb9896
					
				
							
								
								
									
										6
									
								
								db/migrations/0127__fix_inconsistent_isProtected.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								db/migrations/0127__fix_inconsistent_isProtected.sql
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
			
		||||
UPDATE notes SET title = 'Recovered protected note', isProtected = 0 WHERE noteId IN (
 | 
			
		||||
    SELECT noteId FROM notes JOIN note_contents USING(noteId)
 | 
			
		||||
    WHERE notes.isProtected = 1
 | 
			
		||||
      AND note_contents.isProtected = 0
 | 
			
		||||
      AND notes.isDeleted = 0
 | 
			
		||||
)
 | 
			
		||||
@ -4,7 +4,7 @@ const build = require('./build');
 | 
			
		||||
const packageJson = require('../../package');
 | 
			
		||||
const {TRILIUM_DATA_DIR} = require('./data_dir');
 | 
			
		||||
 | 
			
		||||
const APP_DB_VERSION = 126;
 | 
			
		||||
const APP_DB_VERSION = 127;
 | 
			
		||||
const SYNC_VERSION = 6;
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user