Skip to content

materialized view models dont support indexes #450

Description

@MoralCode

Not sure how this was overlooked during #292, but we dont seem to have any kind of mechanism to ensure that any materialized views that get updated (likely recreated) also have their indexes recreated.

see also #314

# NOTE FOR DEVELOPERS: alembic_utils manages materialized view definitions via
# DROP + CREATE (replace). When a view is replaced:
#
# 1. ALL indexes are destroyed. Manually add CREATE UNIQUE INDEX statements
# after the replace op, using MaterializedView.unique_index_columns from
# the registry (collectoss/application/db/materialized_views.py).
#
# 2. The view is recreated WITH NO DATA. You CANNOT run REFRESH CONCURRENTLY
# immediately — it requires both a unique index and pre-existing data.
# After recreating the index, run a non-concurrent refresh first:
# REFRESH MATERIALIZED VIEW augur_data.<view_name> WITH DATA;
# Only after that will the Celery refresh task's CONCURRENTLY succeed.
#

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions