Keep running ssh command after disconnecting from the server
nohup database_migration.sh &
nohupwill take care of running the command and forward command output tonohup.out&will run the command in the background
Use tail -f nohup.out to get the output from the command