MCPcopy Create free account
hub / github.com/cloudbase/garm / migrateFileObjects

Method migrateFileObjects

database/sql/sql.go:469–486  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

467}
468
469func (s *sqlDatabase) migrateFileObjects() error {
470 // Only migrate for SQLite backend
471 if s.cfg.DbBackend != config.SQLiteBackend {
472 return nil
473 }
474
475 // Use the separate objects database connection
476 if s.objectsConn == nil {
477 return fmt.Errorf("objects database connection not initialized")
478 }
479
480 // Use GORM AutoMigrate on the separate connection
481 if err := s.objectsConn.AutoMigrate(&FileObject{}, &FileBlob{}, &FileObjectTag{}); err != nil {
482 return fmt.Errorf("failed to migrate file objects: %w", err)
483 }
484
485 return nil
486}
487
488// migrateAutoVacuum converts SQLite databases from auto_vacuum=NONE to
489// auto_vacuum=INCREMENTAL. This is a one-time migration that allows the

Callers 1

migrateDBMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected