More verbose panic on duplicate migrations

pull/8/head
Vojtech Vitek (V-Teq) 2016-08-15 14:22:11 -04:00
parent 52af0e6a35
commit 6a2ef004b5
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ func (ms migrationSorter) Len() int { return len(ms) }
func (ms migrationSorter) Swap(i, j int) { ms[i], ms[j] = ms[j], ms[i] }
func (ms migrationSorter) Less(i, j int) bool {
if ms[i].Version == ms[j].Version {
panic(fmt.Sprintf("goose: duplicate version %v detected", ms[i].Version))
panic(fmt.Sprintf("goose: duplicate version %v detected:\n%v\n%v", ms[i].Version, ms[i].Source, ms[j].Source))
}
return ms[i].Version < ms[j].Version
}