snippetbashTip
alembic — Database migration tool for SQLAlchemy. More information: <https://manned.org/alembic>.
Viewed 0 times
commandsqlalchemyalembicdatabaseclimigrationtoolfor
Problem
How to use the
alembic command: Database migration tool for SQLAlchemy. More information: <https://manned.org/alembic>.Solution
alembic — Database migration tool for SQLAlchemy. More information: <https://manned.org/alembic>.Initialize Alembic in a project:
alembic init {{path/to/directory}}Create a new migration script with autogeneration:
alembic revision --autogenerate -m "{{message}}"Upgrade the database to the latest revision:
alembic upgrade headDowngrade the database by one revision:
alembic downgrade -1Show the migration history:
alembic historyCode Snippets
Initialize Alembic in a project
alembic init {{path/to/directory}}Create a new migration script with autogeneration
alembic revision --autogenerate -m "{{message}}"Upgrade the database to the latest revision
alembic upgrade headDowngrade the database by one revision
alembic downgrade -1Show the migration history
alembic historyContext
tldr-pages: common/alembic
Revisions (0)
No revisions yet.