Skip to content
This repository was archived by the owner on Jun 28, 2018. It is now read-only.

Commit c0703e7

Browse files
authored
Merge pull request #199 from guzart/date-versions
Date-based versions
2 parents b83285b + d789d50 commit c0703e7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

source/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string
2424
func Parse(raw string) (*Migration, error) {
2525
m := Regex.FindStringSubmatch(raw)
2626
if len(m) == 5 {
27-
versionUint64, err := strconv.ParseUint(m[1], 10, 32)
27+
versionUint64, err := strconv.ParseUint(m[1], 10, 64)
2828
if err != nil {
2929
return nil, err
3030
}

source/parse_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ func TestParse(t *testing.T) {
5050
Raw: "1485385885_foobar.up.sql",
5151
},
5252
},
53+
{
54+
name: "20170412214116_date_foobar.up.sql",
55+
expectErr: nil,
56+
expectMigration: &Migration{
57+
Version: 20170412214116,
58+
Identifier: "date_foobar",
59+
Direction: Up,
60+
Raw: "20170412214116_date_foobar.up.sql",
61+
},
62+
},
5363
{
5464
name: "-1_foobar.up.sql",
5565
expectErr: ErrParse,

0 commit comments

Comments
 (0)