You can provide an entityManager using --em=name option in the migration task. I also add this piece of code, to avoid executing of the migration on another db by mistake:
$parameters = $this->connection->getParams();
$this->skipIf(
$parameters['dbname'] != "my_db_name"
'This is the other DB's migration, pass a correct --em parameter'
);
I haven't found any other way to check the EM, so I can't help you if your databases have same names.
Also note, that you should add the skipIf to all your migrations, so you can migrate without worry in both you databases.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…