Files
odoo-ai/setup.sh
Carlos Garcia 6d15859779 fix(setup.sh): detect stale DB volume, run Alembic migrations on startup
- Before bringing up the stack, check if the agent-db volume exists but
  is missing the expected database (left from a previous broken run with
  wrong POSTGRES_DB). Offer to wipe and re-init automatically.
- After docker compose up, wait for pg_isready then run
  `alembic upgrade head` inside the agent container so tables are created
  before the agent attempts to use them.
- Restart agent-service after migrations so it connects to a fully
  initialized database on its first attempt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:39:51 -04:00

19 KiB