Fixed #19120 - added DB_DUMP_SINGLE_TRANSACTION to .env for RDS support
This commit is contained in:
@@ -37,6 +37,7 @@ MYSQL_ROOT_PASSWORD=changeme1234
|
||||
DB_PREFIX=null
|
||||
DB_DUMP_PATH='/usr/bin'
|
||||
DB_DUMP_SKIP_SSL=true
|
||||
DB_DUMP_SINGLE_TRANSACTION=false
|
||||
DB_CHARSET=utf8mb4
|
||||
DB_COLLATION=utf8mb4_unicode_ci
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ DB_PASSWORD=null
|
||||
DB_PREFIX=null
|
||||
DB_DUMP_PATH='/usr/bin'
|
||||
DB_DUMP_SKIP_SSL=false
|
||||
DB_DUMP_SINGLE_TRANSACTION=false
|
||||
DB_CHARSET=utf8mb4
|
||||
DB_COLLATION=utf8mb4_unicode_ci
|
||||
DB_SANITIZE_BY_DEFAULT=false
|
||||
|
||||
+7
-1
@@ -11,12 +11,18 @@
|
||||
// This is used by the mysql dump options in spatie backup
|
||||
$dump_options = [
|
||||
'dump_binary_path' => env('DB_DUMP_PATH', '/usr/local/bin'), // only the path, so without 'mysqldump'
|
||||
'use_single_transaction' => false,
|
||||
'timeout' => 60 * 5, // 5 minute timeout
|
||||
// 'exclude_tables' => ['table1', 'table2'],
|
||||
// 'add_extra_option' => '--optionname=optionvalue',
|
||||
];
|
||||
|
||||
// spatie/laravel-backup 9.x treats false and null identically in callMethodOnDumper,
|
||||
// so the only way to disable single-transaction mode is to omit the key entirely.
|
||||
// Set DB_DUMP_SINGLE_TRANSACTION=true to opt in (required for non-RDS MySQL).
|
||||
if (env('DB_DUMP_SINGLE_TRANSACTION') == 'true') {
|
||||
$dump_options['use_single_transaction'] = true;
|
||||
}
|
||||
|
||||
// For modern versions of mysqldump, use --ssl-mode=DISABLED
|
||||
if (env('DB_DUMP_SKIP_SSL') == 'true') {
|
||||
// Correctly add the option as a string to the 'add_extra_option' key.
|
||||
|
||||
Reference in New Issue
Block a user