File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ have versions. A version is a string is alphanumerically sortable. In the
13
13
case the file storage each migration file name should match the format
14
14
described by this regex:
15
15
16
- ``` ^([\d\-_]+)[\-_]([\w\-]+)[\-_](apply|rollback)(\.\w+)?$ ```
16
+ ``` ^([\d\-_]+: )[\-_]([\w\-]+)[\-_](apply|rollback)(\.\w+)?$ ```
17
17
18
18
The file name consists of
19
19
20
- - the version (numbers, "_ ", and "-" characters)
20
+ - the version (numbers, "_ ", ":", and "-" characters)
21
21
- a "-" or "_ " character
22
22
- a name for the migration (numbers, alpha, "_ ", and "-" characters)
23
23
- a "-" or "_ " character
@@ -34,8 +34,8 @@ Examples of possible file names:
34
34
35
35
```
36
36
/path/to/migrations/directory
37
- 2020-10-01-153535 -migration-name-apply
38
- 2020-10-01-153535 -migration-name-rollback
37
+ 2020-10-01-15:35:35 -migration-name-apply
38
+ 2020-10-01-15:35:35 -migration-name-rollback
39
39
```
40
40
41
41
Because the versions are strings and sorted alpha-numerically "1" and "10" come
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
11
11
)
12
12
13
13
var (
14
- migratationFileNameRe = regexp .MustCompile (`^([\d\-_]+)[\-_]([\w\-]+)[\-_](apply|rollback)(\.\w+)?$` )
14
+ migratationFileNameRe = regexp .MustCompile (`^([\d\-_: ]+)[\-_]([\w\-]+)[\-_](apply|rollback)(\.\w+)?$` )
15
15
)
16
16
17
17
// FileStorage ...
You can’t perform that action at this time.
0 commit comments