2021-12-13 17:00:27 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
2024-09-10 09:05:30 +02:00
|
|
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
|
|
|
|
|
|
|
# NOTE when running in docker, rust might not exist so we need to check for it
|
|
|
|
if [ -d "$SCRIPT_DIR/../rust" ]; then
|
|
|
|
bash $SCRIPT_DIR/../rust/bin/migrate-cyclotron
|
|
|
|
fi
|
2021-12-13 17:00:27 +01:00
|
|
|
|
|
|
|
python manage.py migrate
|
|
|
|
python manage.py migrate_clickhouse
|
2022-09-01 16:43:09 +02:00
|
|
|
|
|
|
|
# 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.
|
2022-03-09 13:55:23 +01:00
|
|
|
python manage.py run_async_migrations --check
|
2022-09-01 16:43:09 +02:00
|
|
|
|
|
|
|
python manage.py sync_replicated_schema
|