-
Notifications
You must be signed in to change notification settings - Fork 48
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
[Question] How to add a unique index to definition for PGMaterializedView #94
Comments
currently there is no way to have there is some more discussion and a partial implementation over at #46 but for now I'd recommend managing them manually If you're trying to do something highly consistent, like add a unique index on |
@olirice I would appreciate if you provided a hook example, which can be used with |
ok found a hook named |
Found a way around this by creating a new PGMaterializedViewExtended class which took the indexes that should be included with the MV as a parameter. It then injects create scripts for the indexes into the MV definition to aid with detecting changes. |
@phenry2 do you have this class public anywhere? |
Hi there
I have a materialized view defined using
PGMaterializedView
in a views.py file. The views had already been created in the database.I want to now add a unique index to my view - can I do this in the definition of a
PGMaterializedView
and manage the update with alembic?As a minimal example:
I now want to add a unique index to the view and have this managed by alembic, namely:
I can't add this to the
definition
argument. So, is there some way to manage this?The text was updated successfully, but these errors were encountered: