Commit 8d193eaa by luoqi

fix:数据库备份

parent 95a2e798
Pipeline #3227 passed with stage
in 23 seconds
...@@ -94,7 +94,7 @@ def backup_database(): ...@@ -94,7 +94,7 @@ def backup_database():
backup_file = backup_dir / f"backup_before_migration_{timestamp}.sql" backup_file = backup_dir / f"backup_before_migration_{timestamp}.sql"
# 构建备份命令 # 构建备份命令
backup_command = f"docker exec patient_callback_mysql mysqldump -u callback_user -pdev_password_123 callback_system > {backup_file}" backup_command = f"mysqldump -h mysql -u callback_user -pdev_password_123 callback_system > {backup_file}"
print(f"📁 备份文件: {backup_file}") print(f"📁 备份文件: {backup_file}")
return run_command(backup_command, f"备份数据库到 {backup_file.name}") return run_command(backup_command, f"备份数据库到 {backup_file.name}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment