MCPcopy
hub / github.com/apache/devlake / InitExecuteMigration

Function InitExecuteMigration

backend/server/services/init.go:97–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95}
96
97func InitExecuteMigration() {
98 // check if there are pending migration
99 logger.Info("has pending scripts? %v, FORCE_MIGRATION: %v", migrator.HasPendingScripts(), cfg.GetBool("FORCE_MIGRATION"))
100 if migrator.HasPendingScripts() {
101 if cfg.GetBool("FORCE_MIGRATION") {
102 errors.Must(ExecuteMigration())
103 logger.Info("db migration without confirmation")
104 } else {
105 serviceStatus = SERVICE_STATUS_WAIT_CONFIRM
106 logger.Info("db migration confirmation needed")
107 }
108 } else {
109 errors.Must(ExecuteMigration())
110 logger.Info("no db migration needed")
111 }
112}
113
114// Init the services module
115// Should not be called concurrently

Callers

nothing calls this directly

Calls 4

ExecuteMigrationFunction · 0.85
GetBoolMethod · 0.80
InfoMethod · 0.65
HasPendingScriptsMethod · 0.65

Tested by

no test coverage detected