-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrations break on 5.3 on CREATE INDEX CONCURRENTLY #27334
Comments
Hi @djeux, Patches and minor fixes for 5.3 are no longer supported. See https://laravel.com/docs/5.7/releases#support-policy Are you able to replicate this issue on 5.5 LTS or 5.7? |
Heya, unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so feel free to reply and we'll try to have a look. |
The "problem" still exists (I'm on 5.7 with Postgres). However one can argue the change itself is a deliberate design decision hence not necessarily a bug. The "feature request" would be about making it easier and more specific when to disable DDL transactions for certain operations. I think this is best left for a discussion at https://github.com/laravel/ideas followed by a PR when there's consensus. |
As a workaround, you can commit the transaction before executing your query: DB::commit();
DB::statement('CREATE INDEX CONCURRENTLY ...'); In Laravel 5.5+, you can add this to your migration (#22757): public $withinTransaction = false; |
Description:
If a migration contains DB::statement('CREATE INDEX CONCURRENTLY') , which is a way in postgres to create indexes without locking. The migration will fail due to postgres unable to wrap this statement inside a transaction
The only workaround for this is disabling them all together for migrations
Steps To Reproduce:
Add DB::statement('CREATE INDEX CONCURRENTLY ...') inside a migration up() method.
The text was updated successfully, but these errors were encountered: