## 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
from posthog.queries.base import properties_to_Q
        events = self
        any_step = Q()
        steps = action.steps.all()
        if len(steps) == 0:
            return self.none()
        for step in steps:
            step_filter = Filter(data={"properties": step.properties})
            subquery = (
                Event.objects.add_person_id(team_id=action.team_id)
                .filter(
                    properties_to_Q(step_filter.properties, team_id=action.team_id),
                    pk=OuterRef("id"),
                    **self.filter_by_event(step),
                    **self.filter_by_element(model_to_dict(step), team_id=action.team_id),
                    **self.filter_by_period(start, end),
                )
                .only("id")
            )
            subquery = self.filter_by_url(step, subquery)
            any_step |= Q(Exists(subquery))
        events = self.filter(team_id=action.team_id).filter(any_step)
        if order_by:
            events = events.order_by(order_by)
        return events
    def filter_by_action(self, action: Action, order_by: str = "-id") -> models.QuerySet: