Skip to content

Commit

Permalink
refactor: Use UTC for timestamps when creating a migration (#242)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Fridman <[email protected]>
  • Loading branch information
linux2647 and mfridman authored Dec 15, 2023
1 parent 6e43ae9 commit c541882
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Improve provider `Apply()` errors, add `ErrNotApplied` when attempting to rollback a migration
that has not been previously applied. (#660)
- Add `WithDisableGlobalRegistry` option to `NewProvider` to disable the global registry. (#645)
- Add `-timeout` flag to CLI to set the maximum allowed duration for queries to run. Default is
remains no timeout.
- Add `-timeout` flag to CLI to set the maximum allowed duration for queries to run. Default remains
no timeout. (#627)

⚠️ Potential Breaking Change ⚠️

- Update `goose create` to use UTC time instead of local time. (#242)

## [v3.16.0] - 2023-11-12

Expand Down
2 changes: 1 addition & 1 deletion create.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func SetSequential(s bool) {

// Create writes a new blank migration file.
func CreateWithTemplate(db *sql.DB, dir string, tmpl *template.Template, name, migrationType string) error {
version := time.Now().Format(timestampFormat)
version := time.Now().UTC().Format(timestampFormat)

if sequential {
// always use DirFS here because it's modifying operation
Expand Down

0 comments on commit c541882

Please sign in to comment.