Safely manage Flask-Migrate database migrations — generate, review, apply, or rollback. Use when making model changes that require a migration.
git branch --show-currentpoetry run flask db history --indicate-current 2>/dev/null | head -10$ARGUMENTS
If $ARGUMENTS clearly indicates an operation (generate, upgrade, downgrade, history), proceed to that step directly. Otherwise, ask the user using AskUserQuestion with these options:
git diff -- models/ so they can confirm what will be detectedpoetry run flask db migrate -m "<message>"migrations/versions/down_revision or empty upgrade()/downgrade() functionspoetry run flask db heads and poetry run flask db currentpoetry run flask db upgradepoetry run flask db currentpoetry run flask db currentpoetry run flask db history --indicate-current | head -5poetry run flask db downgradepoetry run flask db currentRun poetry run flask db history --indicate-current and display the output.
upgrade or downgrade without user confirmation