fleet/server/goose/create.go
Ian Littman 662b346d5a
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
2025-11-24 15:49:10 -06:00

18 lines
363 B
Go

package goose
import (
"database/sql"
"fmt"
"time"
)
// 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().UTC())
if err != nil {
return err
}
fmt.Printf("Created %s migration files at %v\n", migrationType, paths)
return nil
}