## Bug description
Hi, after upgrade from 1.23.1 to 1.24.0 we see in the migration this error
```
django.db.utils.NotSupportedError: cannot create index on partitioned table "posthog_event" concurrently
``` 

We have the events table partitioned using the inbuilt tool and apparently the migration does not handle that well. 

## Environment
Self-hosted instance running in Kubernetes using upstream docker images
posthog/models/event.py
def _element_subquery(self, selector: Selector) -> Tuple[Dict[str, Subquery], Dict[str, Union[F, bool]]]:
        filter: Dict[str, Union[F, bool]] = {}
        subqueries = {}
        for index, tag in enumerate(selector.parts):
            subqueries["match_{}".format(index)] = Subquery(
                Element.objects.filter(group_id=OuterRef("pk"))
                .values("order")
                .order_by("order")
                .extra(**tag.extra_query)  
                
                [tag.unique_order : tag.unique_order + 1]
            )
            filter["match_{}__isnull".format(index)] = False
            if index > 0:
                
                if tag.direct_descendant:
                    filter["match_{}".format(index)] = F("match_{}".format(index - 1)) + 1
                else:
                    
                    filter["match_{}__gt".format(index)] = F("match_{}".format(index - 1))
        return (subqueries, filter)
    def earliest_timestamp(self, team_id: int):