From c381362b3a0c289a68296f37454cb89e577ef396 Mon Sep 17 00:00:00 2001 From: Lily Cohen Date: Mon, 21 Sep 2026 12:15:56 -0600 Subject: [PATCH] Fix Postgres backup connection and statuses nullability --- config/backup.php | 17 +++++++++- ...94847_fix_non_nullable_postgres_errors.php | 32 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2025_02_10_194847_fix_non_nullable_postgres_errors.php diff --git a/config/backup.php b/config/backup.php index 3e9aff72f..a535a7b17 100644 --- a/config/backup.php +++ b/config/backup.php @@ -77,8 +77,23 @@ return [ ], ], + 'mariadb' => [ + 'dump' => [ + 'useSingleTransaction' => true, + 'useQuick' => true, + ], + ], + + 'pgsql' => [ + 'dump' => [ + 'useSingleTransaction' => true, + 'useQuick' => true, + ], + ], + + // Hardcoding 'mysql' breaks backup:run on non-MySQL installs 'databases' => [ - 'mysql', + env('DB_CONNECTION', 'mysql'), ], ], diff --git a/database/migrations/2025_02_10_194847_fix_non_nullable_postgres_errors.php b/database/migrations/2025_02_10_194847_fix_non_nullable_postgres_errors.php new file mode 100644 index 000000000..8eb0f43c6 --- /dev/null +++ b/database/migrations/2025_02_10_194847_fix_non_nullable_postgres_errors.php @@ -0,0 +1,32 @@ +change()` without `->nullable()`, making both columns NOT NULL. + * DirectMessageController still writes null into caption, which errors + * on PostgreSQL. + */ + public function up(): void + { + Schema::table('statuses', function ($table) { + $table->text('caption')->nullable()->change(); + $table->text('rendered')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +};