feat: 支持数据库迁移脏状态自动恢复和Neo4j连接重试机制

This commit is contained in:
wizardchen
2025-12-08 19:38:16 +08:00
parent 8eb737ae28
commit c67a5d3949
9 changed files with 829 additions and 474 deletions
+5 -2
View File
@@ -96,10 +96,13 @@ case "$1" in
if [ -z "$2" ]; then
echo "Error: Version number is required"
echo "Usage: $0 force <version>"
echo "Note: Use -1 to reset to no version (allows re-running all migrations)"
exit 1
fi
echo "Forcing migration version to $2..."
migrate -path ${MIGRATIONS_DIR} -database ${DB_URL} force $2
VERSION="$2"
echo "Forcing migration version to $VERSION..."
# Use env to pass the command, avoiding shell flag parsing issues with negative numbers
env migrate -path "${MIGRATIONS_DIR}" -database "${DB_URL}" force -- "$VERSION"
;;
goto)
if [ -z "$2" ]; then