#!/bin/bash set -e python manage.py migrate python manage.py migrate_clickhouse # NOTE: we do not apply any non-noop migrations here. Rather these are run # manually within the UI. See https://posthog.com/docs/runbook/async-migrations # for details. python manage.py run_async_migrations --complete-noop-migrations # NOTE: this check should not fail if a migration isn't complete but within the # given async migration posthog version range, thus this should not block e.g. # k8s pod deployments. python manage.py run_async_migrations --check python manage.py sync_replicated_schema