## 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
import copy
import datetime
import re
from collections import defaultdict
from typing import Any, Dict, List, Tuple, Union
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db import connection, models, transaction
from django.db.models import Exists, F, OuterRef, Prefetch, Q, QuerySet, Subquery
from django.forms.models import model_to_dict
from django.utils import timezone
from posthog.ee import is_clickhouse_enabled
from .action import Action
from .action_step import ActionStep
from .element import Element
from .element_group import ElementGroup
from .filters import Filter
from .person import Person, PersonDistinctId
from .team import Team
from .utils import namedtuplefetchall
attribute_regex = r"([a-zA-Z]*)\[(.*)=[\'|\"](.*)[\'|\"]\]"
LAST_UPDATED_TEAM_ACTION: Dict[int, datetime.datetime] = {}
TEAM_EVENT_ACTION_QUERY_CACHE: Dict[int, Dict[str, tuple]] = defaultdict(dict)
TEAM_ACTION_QUERY_CACHE: Dict[int, str] = {}
DEFAULT_EARLIEST_TIME_DELTA = relativedelta(weeks=1)
class SelectorPart(object):
    direct_descendant = False
    unique_order = 0
    def _unescape_class(self, class_name):