()
| 95 | } |
| 96 | |
| 97 | func 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 |
nothing calls this directly
no test coverage detected