Digging into the Illuminate\Database\Console\DumpCommand class it is indeed supposed to append all migrations into the dump file. But there's a bug in the implementation.
Dump command runs
return $connection->getSchemaState()
->withMigrationTable($connection->getTablePrefix().Config::get('database.migrations', 'migrations'))
->handleOutputUsing(function ($type, $buffer) {
$this->output->write($buffer);
});
This sets the migration table name to prefix_migrations.
Next Illuminate\Database\Schema\SchemaState::hasMigrationTable runs Illuminate\Database\Schema\Builder::hasTable with the given value prefix_migrations.
However, the hasTable method adds the prefix again, making it try to find a table named prefix_prefix_migrations - and that obviously does not exist.
I'll post a bug issue for this. Thanks for the input.
This is in Laravel version 10.48.29, and that's no longer supported. It may have been fixed in later versions. It is possible to get around by manually removing the line
$table = $this->connection->getTablePrefix().$table;
from Illuminate\Database\Schema\Builder. Just remember to re-add it again after running the dump command.