mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
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:
@@ -6,6 +6,12 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user