refactor: Use UTC for timestamps when creating a migration (#242)

Co-authored-by: Mike Fridman <mf192@icloud.com>
pull/667/head
Stephen Howell 2023-12-14 21:09:08 -07:00 committed by GitHub
parent 6e43ae9284
commit c541882fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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