| 106 | } |
| 107 | |
| 108 | func friendlyError(w io.Writer, err error, v1, v2 string) { |
| 109 | _, _ = fmt.Fprintf(w, "Migrating from version %q to %q failed:\n", v1, v2) |
| 110 | _, _ = fmt.Fprintf(w, "\t%s\n", err.Error()) |
| 111 | _, _ = fmt.Fprintf(w, "Check the following:\n") |
| 112 | _, _ = fmt.Fprintf(w, " - All migrations from version %q must exist in version %q with the same migration numbers.\n", v2, v1) |
| 113 | _, _ = fmt.Fprintf(w, " - Each migration must have the same effect.\n") |
| 114 | _, _ = fmt.Fprintf(w, " - There must be no gaps or duplicates in the migration numbers.\n") |
| 115 | } |
| 116 | |
| 117 | func makeMigrateFS(version string) (fs.FS, error) { |
| 118 | // Export the migrations from the requested version to a zip archive |