Skip to content

Avoid dropping version table for offline SQL base#1824

Open
w-Jessamine wants to merge 1 commit into
sqlalchemy:mainfrom
w-Jessamine:fix/stamp-base-sql-version-table
Open

Avoid dropping version table for offline SQL base#1824
w-Jessamine wants to merge 1 commit into
sqlalchemy:mainfrom
w-Jessamine:fix/stamp-base-sql-version-table

Conversation

@w-Jessamine

Copy link
Copy Markdown

Description

When offline SQL generation ends at base, Alembic emitted DROP TABLE alembic_version. This removes that offline-only table drop so SQL output matches online behavior: Alembic updates version rows but does not drop the version table.

Fixes #1822.

Checklist

This pull request is:

  • A documentation / typographical error fix
  • A short code fix
  • A new feature implementation

Validation

  • /tmp/alembic-pr-venv/bin/python -m pytest tests/test_command.py::UpgradeDowngradeStampTest -q
  • /tmp/alembic-pr-venv/bin/python -m pytest tests/test_command.py -k stamp -q
  • /tmp/alembic-pr-venv/bin/python -m pytest tests/test_command.py -q
  • /tmp/alembic-pr-venv/bin/python -m compileall -q alembic/runtime/migration.py tests/test_command.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stamp command with "base" emits a DROP if --sql mode is present and no head revisions are present

1 participant