xelixdev / django-pgviews-redux

Fork of django-postgres that focuses on maintaining and improving support for Postgres SQL Views.
The Unlicense
64 stars 15 forks source link

Drop views before migration #59

Open metheoryt opened 4 months ago

metheoryt commented 4 months ago

Hi! I have a model that my views depend on, and when I try to change that model and migrate it, I get

django.db.utils.NotSupportedError: cannot alter type of a column used by a view or rule
DETAIL:  rule _RETURN on materialized view some_view depends on column "some_column"

The problem could be avoided if the views will be dropped before the migration, and recreated after.