Skip to content
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

Phinx cannot create indexes concurrently for postgres databases #1152

Closed
gr1ev0us opened this issue Aug 24, 2017 · 5 comments
Closed

Phinx cannot create indexes concurrently for postgres databases #1152

gr1ev0us opened this issue Aug 24, 2017 · 5 comments

Comments

@gr1ev0us
Copy link

There is no way to perform query which create index concurrently because phinx runs queries in transaction.
So migration have to has option to performs without transaction. For example, check this option in Phinx\Migration\Manager\Environment::executeMigration

@lorenzo
Copy link
Member

lorenzo commented Aug 24, 2017

Maybe indexes should be done outside of the transaction instead?

@gr1ev0us
Copy link
Author

Sure. And phinx has to provide ability to do this.

@matejstrasek
Copy link

Is there any workaround for this by now?

@rquadling
Copy link
Collaborator

You could just commit the transaction early.

$this->getAdapter()->commitTransaction();
\\ Now build your index.

If you do this a lot, then create an abstract migration class and / or a template that does this for you.

Though, probably, doing it on a case-by-case basis will be what I'd prefer.

@othercorey
Copy link
Member

Closing due to lack of activity or out of scope. If there is new interest, please open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants