# Alembic database schema migration management

## Configuration type
Generic single-database configuration.

## Sample usage

### Generate new migration from schema changes in Python models
All subsequent commands assume you are in the dir that alemic.ini is in
`$ alembic revision --autogenerate -m "My migration name"`

### Generate new blank migration script
`$ alembic revision -m "create users table"`
This creates a new file like alembic/versions/xxxx_create_users_table.py with an empty upgrade() and downgrade()

### Add migration content
Inside the generated migration file, manually write SQL or use Alembic’s op API to represent the database changes you want

### Run the migration
`$ alembic upgrade head`

### Check status
`$ alembic current`  # shows current DB migration revision
`$ alembic history`  # shows all migrations
