Data migration scripts live inDocumentation Index
Fetch the complete documentation index at: https://openwearables.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
backend/scripts/data_migrations/. They are run manually — not applied automatically on deploy — and are intended for one-off corrections, backfills, or clean-ups that cannot be expressed as a zero-downtime Alembic migration.
Prerequisites
The scripts import from theapp package and connect to the database via the environment variables in backend/config/.env. You need:
- Docker Compose services running (
docker compose up -d) - The
appcontainer healthy (check withdocker compose ps) - A database with the latest Alembic migrations applied (
docker compose exec app uv run alembic upgrade head)
Running a script
All scripts are run inside theapp container using uv run:
Dry run first
Every script supports a--dry-run flag. Always run it first — it prints the rows that would be affected without making any changes:

