MCPcopy Create free account
hub / github.com/chain/Core / PrintStatus

Function PrintStatus

core/migrate/migrate.go:58–73  ·  view source on GitHub ↗

PrintStatus prints the status of each built-in migration.

(db pg.DB)

Source from the content-addressed store, hash-verified

56
57// PrintStatus prints the status of each built-in migration.
58func PrintStatus(db pg.DB) error {
59 err := loadStatus(db, migrations)
60 if err != nil {
61 return err
62 }
63
64 fmt.Printf("%-60s\t%-6s\t%s\n", "filename", "hash", "applied_at")
65 for _, m := range migrations {
66 appliedAt := "(pending)"
67 if !m.AppliedAt.IsZero() {
68 appliedAt = m.AppliedAt.Format(time.RFC3339)
69 }
70 fmt.Printf("%-60s\t%-6s\t%s\n", m.Name, m.Hash[:6], appliedAt)
71 }
72 return nil
73}
74
75const createMigrationTableSQL = `
76 CREATE TABLE IF NOT EXISTS migrations (

Callers

nothing calls this directly

Calls 3

loadStatusFunction · 0.85
FormatMethod · 0.80
IsZeroMethod · 0.45

Tested by

no test coverage detected