MCPcopy
hub / github.com/rubenv/sql-migrate / migrationFromFile

Function migrationFromFile

migrate.go:288–301  ·  view source on GitHub ↗
(dir http.FileSystem, root string, info os.FileInfo)

Source from the content-addressed store, hash-verified

286}
287
288func migrationFromFile(dir http.FileSystem, root string, info os.FileInfo) (*Migration, error) {
289 path := path.Join(root, info.Name())
290 file, err := dir.Open(path)
291 if err != nil {
292 return nil, fmt.Errorf("Error while opening %s: %w", info.Name(), err)
293 }
294 defer func() { _ = file.Close() }()
295
296 migration, err := ParseMigration(info.Name(), file)
297 if err != nil {
298 return nil, fmt.Errorf("Error while parsing %s: %w", info.Name(), err)
299 }
300 return migration, nil
301}
302
303// Migrations from a bindata asset set.
304type AssetMigrationSource struct {

Callers 1

findMigrationsFunction · 0.85

Calls 1

ParseMigrationFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…