kagent db migrate
Apply, roll back, and inspect database migrations.
Apply, roll back, and inspect database migrations independently of server startup. Reads POSTGRES_DATABASE_URL from the environment when –db-url is omitted.
kagent db migrate [command]Subcommands:
kagent db migrate down- Roll back the N most-recent applied migrations for the selected sourcekagent db migrate force- Mark version V as applied without running its SQLkagent db migrate goto- Move the selected source’s schema to version Vkagent db migrate status- Show how many migrations are applied vs pending across all sourceskagent db migrate up- Apply all pending migrations across every registered sourcekagent db migrate version- Print the highest applied migration version
Flags:
--db-url string- PostgreSQL connection URL (defaults to value of POSTGRES_DATABASE_URL env var)-h, --help- help for migrate--source string- Migration source name for per-source ops (down/goto/force/version); inferred when only one source is registered. Not applicable to up or status — those aggregate across every registered source.