From 9c2ef0aa21e2c5a9809d9748253e6b134dfe2019 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:31:39 +0200 Subject: [PATCH] fix(migration): disable transaction for concurrent index creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PostgreSQL does not allow CREATE INDEX CONCURRENTLY to run inside a transaction block. This migration now sets $withinTransaction = false to allow the concurrent index creation to succeed. Fixes the error: "CREATE INDEX CONCURRENTLY cannot run inside a transaction block" when running migrations in dev environment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../2025_06_26_131350_optimize_activity_log_indexes.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/database/migrations/2025_06_26_131350_optimize_activity_log_indexes.php b/database/migrations/2025_06_26_131350_optimize_activity_log_indexes.php index 6ffe97c07..94bcbec32 100644 --- a/database/migrations/2025_06_26_131350_optimize_activity_log_indexes.php +++ b/database/migrations/2025_06_26_131350_optimize_activity_log_indexes.php @@ -6,6 +6,12 @@ return new class extends Migration { + /** + * Disable transactions for this migration because CREATE INDEX CONCURRENTLY + * cannot run inside a transaction block in PostgreSQL. + */ + public bool $withinTransaction = false; + /** * Run the migrations. */