diff --git a/migrate.go b/migrate.go index 26ce946..b425d07 100644 --- a/migrate.go +++ b/migrate.go @@ -79,6 +79,10 @@ func (ms Migrations) String() string { func AddMigration(up func(*sql.Tx) error, down func(*sql.Tx) error) { _, filename, _, _ := runtime.Caller(1) + AddNamedMigration(filename, up, down) +} + +func AddNamedMigration(filename string, up func(*sql.Tx) error, down func(*sql.Tx) error) { v, _ := NumericComponent(filename) migration := &Migration{Version: v, Next: -1, Previous: -1, UpFn: up, DownFn: down, Source: filename}