From 0b250b8511b8176a0528ab7ac13e7ed3f03de009 Mon Sep 17 00:00:00 2001 From: Liam Staskawicz Date: Fri, 4 Jan 2013 19:24:40 -1000 Subject: [PATCH] ensure migration IDs are greater than zero --- migrate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrate.go b/migrate.go index 5b6b0f6..8da7846 100644 --- a/migrate.go +++ b/migrate.go @@ -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