fix: PHP versions fallback and auto-migrate on panel start
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func MigrationsPath() (string, error) {
|
||||
if p := os.Getenv("MIGRATIONS_PATH"); p != "" {
|
||||
return p, nil
|
||||
}
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return filepath.Join(wd, "migrations"), nil
|
||||
}
|
||||
Reference in New Issue
Block a user