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

Create composite index concurrently? #4

Closed
MattDelac opened this issue Oct 18, 2024 · 2 comments
Closed

Create composite index concurrently? #4

MattDelac opened this issue Oct 18, 2024 · 2 comments

Comments

@MattDelac
Copy link

First of all, congrats ! I love the idea of having clean schemas and then generate migrations from the diff of the current state. This is so clean !!!

Is there a way to create a composite index? And even better to have some controls like CREATE INDEX CONCURRENTLY?
Or should I just create a manual migration myself?

Cheers

@blainehansen
Copy link
Owner

Anything you can do in postgres you can do using this tool :) Just add the create index concurrently statement wherever you want in the schema files, and just modify it in the migration files if something such as the concurrently statement is left off.

Ultimately all the diff tool cares about is that the sql in the schema and migration files ends up with the same objects in the information tables, so however you achieve that is up to you!

@MattDelac
Copy link
Author

MattDelac commented Oct 18, 2024

Anything you can do in postgres you can do using this tool :) Just add the create index concurrently statement wherever you want in the schema files, and just modify it in the migration files if something such as the concurrently statement is left off.

Ultimately all the diff tool cares about is that the sql in the schema and migration files ends up with the same objects in the information tables, so however you achieve that is up to you!

Amazing ! will try that later today.
I would advise to maybe showing one of those examples in the README for everyone who might have a similar question 🙂

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

No branches or pull requests

2 participants