_Code and tests are added. Documentation update was omitted because a similar config database_dump_file_timestamp_format is not documented. I'm happy to add documentation should that be required for a merge._
This PR adds a config option at config('backup.backup.database_dump_file_use_connection_name') of type boolean, defaulting to null and thus uses the database name as it always has.
This config, if set to true, uses the connection's key from config('database.connections') in the dump file name instead of the database name
Use Case
I have 2 connections defined to the same database, each with different db-dumper options. I have one to dump only the schema (see my PR to spatie/db-dumper#208) and a second to dump the data of the database, minus the data from large tables (large as in disk space) that I can recreate.
As the package stand now, it names the dump files for these 2 connections the same based on the database name and I only get one file in the zipped archive.
With this PR, I now have both files in the zipped archive, one for each connection.
I'm happy to make any recommended modifications or additions!
_Code and tests are added. Documentation update was omitted because a similar config
database_dump_file_timestamp_format
is not documented. I'm happy to add documentation should that be required for a merge._This PR adds a config option at
config('backup.backup.database_dump_file_use_connection_name')
of type boolean, defaulting tonull
and thus uses the database name as it always has.This config, if set to true, uses the connection's key from
config('database.connections')
in the dump file name instead of the database nameUse Case I have 2 connections defined to the same database, each with different db-dumper options. I have one to dump only the schema (see my PR to spatie/db-dumper#208) and a second to dump the data of the database, minus the data from large tables (large as in disk space) that I can recreate.
As the package stand now, it names the dump files for these 2 connections the same based on the database name and I only get one file in the zipped archive.
With this PR, I now have both files in the zipped archive, one for each connection.
I'm happy to make any recommended modifications or additions!