MigrationCheckError returns the cached error from the most recent migration check for connStr, or nil if the check has not run or succeeded. Use this instead of MigrationNeeded when you need to bail out of the attach path on a failed pre-flight check.
(connStr string)
| 104 | // instead of MigrationNeeded when you need to bail out of the attach path on a |
| 105 | // failed pre-flight check. |
| 106 | func MigrationCheckError(connStr string) error { |
| 107 | if val, ok := migrations.Load(connStr); ok { |
| 108 | state := val.(*migrationState) |
| 109 | return state.err |
| 110 | } |
| 111 | return nil |
| 112 | } |
| 113 | |
| 114 | // MigrationCheckedVersion returns the version found in the metadata store. |
| 115 | // Returns "" if the check has not run or the metadata store had no version. |