mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	shift migrations after upmerge
This commit is contained in:
		
							
								
								
									
										25
									
								
								db/migrations/0218__rename_note_revision_to_revision.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								db/migrations/0218__rename_note_revision_to_revision.sql
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| CREATE TABLE IF NOT EXISTS "revisions" (`revisionId`	TEXT NOT NULL PRIMARY KEY, | ||||
|                                         `noteId`	TEXT NOT NULL, | ||||
|                                         type TEXT DEFAULT '' NOT NULL, | ||||
|                                         mime TEXT DEFAULT '' NOT NULL, | ||||
|                                         `title`	TEXT NOT NULL, | ||||
|                                         `isProtected`	INT NOT NULL DEFAULT 0, | ||||
|                                         blobId TEXT DEFAULT NULL, | ||||
|                                         `utcDateLastEdited` TEXT NOT NULL, | ||||
|                                         `utcDateCreated` TEXT NOT NULL, | ||||
|                                         `utcDateModified` TEXT NOT NULL, | ||||
|                                         `dateLastEdited` TEXT NOT NULL, | ||||
|                                         `dateCreated` TEXT NOT NULL); | ||||
|  | ||||
| INSERT INTO revisions (revisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, blobId) | ||||
| SELECT noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, blobId FROM note_revisions; | ||||
|  | ||||
| DROP TABLE note_revisions; | ||||
|  | ||||
| CREATE INDEX `IDX_revisions_noteId` ON `revisions` (`noteId`); | ||||
| CREATE INDEX `IDX_revisions_utcDateCreated` ON `revisions` (`utcDateCreated`); | ||||
| CREATE INDEX `IDX_revisions_utcDateLastEdited` ON `revisions` (`utcDateLastEdited`); | ||||
| CREATE INDEX `IDX_revisions_dateCreated` ON `revisions` (`dateCreated`); | ||||
| CREATE INDEX `IDX_revisions_dateLastEdited` ON `revisions` (`dateLastEdited`); | ||||
|  | ||||
| UPDATE entity_changes SET entityName = 'revisions' WHERE entityName = 'note_revisions'; | ||||
		Reference in New Issue
	
	Block a user