修复迁移时,数据库未指定的情况下数据库脚本混乱的问题

This commit is contained in:
2025-12-06 22:03:57 +08:00
parent 6547e7bca8
commit b66f345281
7 changed files with 194 additions and 77 deletions

View File

@@ -89,7 +89,7 @@ err := migration.RunMigrationsFromConfigWithCommand("config.json", "migrations",
```
**参数说明**
- `configFile`: 配置文件路径空字符串时自动查找config.json, ../config.json或使用环境变量 DATABASE_URL
- `configFile`: 配置文件路径空字符串时自动查找config.json, ../config.json
- `migrationsDir`: 迁移文件目录,空字符串时使用默认值 "migrations"
- `command`: 命令,支持 "up", "down", "status"