mirror of https://github.com/pressly/goose.git
More verbose panic on duplicate migrations
parent
52af0e6a35
commit
6a2ef004b5
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue