mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	Do not migrate db to new config path (#14123)
I just saw this, and I would be very surprised by that behaviour as a user. Changing the db path would randomly move the database, and changing it back (or to anything, really) would not. These kinds of advanced settings are generally expected to do one thing: Change the path frigate opens the database from. The end.
This commit is contained in:
		
							parent
							
								
									a1efcfb2d0
								
							
						
					
					
						commit
						3c015bf822
					
				@ -35,7 +35,6 @@ from frigate.const import (
 | 
				
			|||||||
    CACHE_DIR,
 | 
					    CACHE_DIR,
 | 
				
			||||||
    CLIPS_DIR,
 | 
					    CLIPS_DIR,
 | 
				
			||||||
    CONFIG_DIR,
 | 
					    CONFIG_DIR,
 | 
				
			||||||
    DEFAULT_DB_PATH,
 | 
					 | 
				
			||||||
    EXPORT_DIR,
 | 
					    EXPORT_DIR,
 | 
				
			||||||
    MODEL_CACHE_DIR,
 | 
					    MODEL_CACHE_DIR,
 | 
				
			||||||
    RECORD_DIR,
 | 
					    RECORD_DIR,
 | 
				
			||||||
@ -151,13 +150,6 @@ class FrigateApp:
 | 
				
			|||||||
            except PermissionError:
 | 
					            except PermissionError:
 | 
				
			||||||
                logger.error("Unable to write to /config to save DB state")
 | 
					                logger.error("Unable to write to /config to save DB state")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Migrate DB location
 | 
					 | 
				
			||||||
        old_db_path = DEFAULT_DB_PATH
 | 
					 | 
				
			||||||
        if not os.path.isfile(self.config.database.path) and os.path.isfile(
 | 
					 | 
				
			||||||
            old_db_path
 | 
					 | 
				
			||||||
        ):
 | 
					 | 
				
			||||||
            os.rename(old_db_path, self.config.database.path)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Migrate DB schema
 | 
					        # Migrate DB schema
 | 
				
			||||||
        migrate_db = SqliteExtDatabase(self.config.database.path)
 | 
					        migrate_db = SqliteExtDatabase(self.config.database.path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user