// ...
public function up()
{
Schema::create('bar', function (Blueprint $table) {
// ...
});
}
public function down()
{
Schema::dropIfExists('bar');
}
// ...
This means that when executing the migrations all operations (like table creation) are executed on the public schema.
It would be helpful to have an option, for example --save-connection, which when enabled in combinatio with --connection='...' saved the connection name:
// ...
public function up()
{
Schema::connection('foo_schema')->create('bar', function (Blueprint $table) {
// ...
});
}
public function down()
{
Schema::connection('foo_schema')->dropIfExists('bar');
}
// ...
Thank you for the details. In fact, generating with the connection name is the expected behavior.
I will label this issue as a bug and push the fix soon.
I have an application which uses multiple schemas on the same DB, with a connection for each schema:
config/database.php
:If I generate the migrations they don't specify the connection for any schema:
database/migrations/..._create_bar_table
:This means that when executing the migrations all operations (like table creation) are executed on the
public
schema. It would be helpful to have an option, for example--save-connection
, which when enabled in combinatio with--connection='...'
saved the connection name:database/migrations/..._create_bar_table
: