[10.x] Ensureschema:dump will dump the migrations table only if it exists - #51827
Conversation
…3-fix-schema-dump # Conflicts: # src/Illuminate/Database/Schema/PostgresSchemaState.php
|
One issue with this PR is we can't use facades from Illuminate components. Configuration will have to be injected. |
|
@taylorotwell I had that thought at first. But then I saw the component already depends on the config facade here. So, I am taking this is undesired? If yes, I'd remove the dependency in one go? Edit: how would you feel about |
|
|
|
Edit: was answered here #51813 (comment)
Interesting! I would have expected that each tenant has a own database config, and therefore each tenant an own default connection as well. To confirm I understand you correctly, |
schema:dump will dump the migrations table only if it exists
|
I pushed the changes. Didn't touch the existing cc @Tofandel |
There is one default connection which is the main app, and each tenant has it's own database, but only one connection is configured for all the tenants (its the |
Fixes #51813
The
migrationstable is only available in then default connection.When running
schema:dump --database=Somethingthe command attempts to dump the migration table, too.This results in:
This PR checks if we are on the default connection and skips dumping migrations if not.
The command has not had any tests.
I don't think the scope of this PR requires to change this?