I'm trying to run Flyway migrations on 11 different databases at the same time. I'm doing this via a batch file...
@echo off
setlocal
set FLYWAY_EXE=C:\flyway-3.2.1\flyway
for /d %%f in (%~dp0props_flyway\*) do (
start "%%~nf" %FLYWAY_EXE% migrate -configFile=%~dp0props_flyway\%%~nf\flyway.conf
)
set FLYWAY_EXE=
@echo on
This approach works fine, but it leaves me with 11 command prompt windows open and I need to manually go into each and type "exit". Is it possible for these command prompt windows to automatically close after the flyway migration has done its work to save me having to close them all manually?
I can do it without using start. It then performs the migrations consecutively, however I'd rather do them in parallel to save time.
I have tried the approach of using an empty string after start from this question, but this does nothing for me on Windows 8.1, except to open the command prompt with an empty title instead of the one I want to have.
I've also tried...
cmd /c "start ^"%%~nf^" %FLYWAY_EXE% migrate -configFile=%~dp0props_flyway\%%~nf\flyway.conf"
...to no avail.
Anyone know how I can start each of these migrations up and have them close automatically upon completion?