mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Use UTC timestamps for DB migrations (#36228)
No changes file because this is just a tooling change rather than a functionality change. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) ## Testing - [x] QA'd all new/changed functionality manually
This commit is contained in:
parent
cb26f43472
commit
662b346d5a
2 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
// Create writes a new blank migration file.
|
||||
func Create(db *sql.DB, dir, name, migrationType string) error {
|
||||
paths, err := CreateMigration(name, migrationType, dir, time.Now())
|
||||
paths, err := CreateMigration(name, migrationType, dir, time.Now().UTC())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ func main() {
|
|||
if _, err := time.Parse(timeFormat, oldTimestamp); err != nil {
|
||||
log.Fatalf("Bad filename pattern, '%s' is not a valid timestamp in '%s'", oldTimestamp, sourceFilename)
|
||||
}
|
||||
newTimestamp := time.Now().Format(timeFormat)
|
||||
newTimestamp := time.Now().UTC().Format(timeFormat)
|
||||
|
||||
newMig, newTest, err := renameMigrationFiles(migrationsDir, sourceFilename, oldTimestamp, newTimestamp)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue