mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
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
18 lines
363 B
Go
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
|
|
}
|