mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	- use CSS contain wherever possible to reduce subtrees of forced reflows - reduced dependency between note and note_contents updates which will reduce number of updates to components - optimization of "many rows" querying
		
			
				
	
	
		
			21 lines
		
	
	
		
			867 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			867 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
| CREATE TABLE IF NOT EXISTS "note_contents_mig" (
 | |
|                                                `noteId`	TEXT NOT NULL,
 | |
|                                                `content`	TEXT NULL DEFAULT NULL,
 | |
|                                                `hash` TEXT DEFAULT "" NOT NULL,
 | |
|                                                `dateModified` TEXT NOT NULL,
 | |
|                                                `utcDateModified` TEXT NOT NULL,
 | |
|                                                PRIMARY KEY(`noteId`)
 | |
| );
 | |
| 
 | |
| INSERT INTO note_contents_mig (noteId, content, hash, dateModified, utcDateModified)
 | |
|     SELECT noteId,
 | |
|            content,
 | |
|            hash,
 | |
|            (SELECT dateModified FROM notes WHERE noteId = note_contents.noteId),
 | |
|            utcDateModified
 | |
|     FROM note_contents;
 | |
| 
 | |
| DROP TABLE note_contents;
 | |
| 
 | |
| ALTER TABLE note_contents_mig RENAME TO note_contents;
 |