fix(migration): disable transaction for concurrent index creation

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 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai 2025-10-10 18:31:39 +02:00
parent 9481247ef4
commit 9c2ef0aa21

View file

@ -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.
*/