CREATE INDEX IF NOT EXISTS idx_rev_mat_prefix_rev_prefix
    ON revision_materialized_prefix (revision_id, prefix);

CREATE INDEX IF NOT EXISTS idx_module_tenant_active_sort
    ON module (tenant_id, priority, name)
    WHERE deleted_at IS NULL;

CREATE UNIQUE INDEX IF NOT EXISTS idx_rev_mat_prefix_uniq
    ON revision_materialized_prefix (revision_id, prefix, community_id, source);
