Skip to content

Commit

Permalink
Use 1-indexed month number in migration names (#1)
Browse files Browse the repository at this point in the history
The month numbers `tm_mon` are
[0-indexed](https://ocaml.org/api/Unix.html#TYPEtm), but we use these numbers
in the migration file names. This can be confusing to the users.

The current commit changes the month numbers to be "human readable" by
switching to 1-indexed month numbers.
  • Loading branch information
punchagan authored Oct 20, 2021
1 parent 376ac71 commit 2b5b16a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/commands/cmd_create.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let run ~dir ~name =
Printf.sprintf
"%d%02d%02d%02d%02d%02d"
(1900 + tm.Unix.tm_year)
tm.Unix.tm_mon
(1 + tm.Unix.tm_mon)
tm.Unix.tm_mday
tm.Unix.tm_hour
tm.Unix.tm_min
Expand Down

0 comments on commit 2b5b16a

Please sign in to comment.