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