A free open source IT asset/license management system
Fixed #19120 - added DB_DUMP_SINGLE_TRANSACTION to .env for RDS support
snipe79732a9151b6
diff --git a/.env.docker b/.env.dockerindex 2ebcf99694..6a7bc2b3cb 100644--- a/.env.docker+++ b/.env.docker@@ -37,6 +37,7 @@ MYSQL_ROOT_PASSWORD=changeme1234DB_PREFIX=nullDB_DUMP_PATH='/usr/bin'DB_DUMP_SKIP_SSL=true+DB_DUMP_SINGLE_TRANSACTION=falseDB_CHARSET=utf8mb4DB_COLLATION=utf8mb4_unicode_cidiff --git a/.env.example b/.env.exampleindex 47937af615..dfce45fa54 100644--- a/.env.example+++ b/.env.example@@ -32,6 +32,7 @@ DB_PASSWORD=nullDB_PREFIX=nullDB_DUMP_PATH='/usr/bin'DB_DUMP_SKIP_SSL=false+DB_DUMP_SINGLE_TRANSACTION=falseDB_CHARSET=utf8mb4DB_COLLATION=utf8mb4_unicode_ciDB_SANITIZE_BY_DEFAULT=falsediff --git a/config/database.php b/config/database.phpindex 3a3b3eff1b..9a2447fbe2 100755--- a/config/database.php+++ b/config/database.php@@ -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=DISABLEDif (env('DB_DUMP_SKIP_SSL') == 'true') {// Correctly add the option as a string to the 'add_extra_option' key.