mirror of https://github.com/pressly/goose.git
ensure migration IDs are greater than zero
parent
517e1701e2
commit
0b250b8511
|
@ -197,8 +197,8 @@ func numericComponent(name string) (int64, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
n, e := strconv.ParseInt(base[:idx], 10, 64)
|
n, e := strconv.ParseInt(base[:idx], 10, 64)
|
||||||
if e == nil && n == 0 {
|
if e == nil && n <= 0 {
|
||||||
return 0, errors.New("0 is not a valid migration ID")
|
return 0, errors.New("migration IDs must be greater than zero")
|
||||||
}
|
}
|
||||||
|
|
||||||
return n, e
|
return n, e
|
||||||
|
|
Loading…
Reference in New Issue