26 lines
450 B
Markdown
26 lines
450 B
Markdown
# Alembic
|
|
|
|
Alembic allows for our database migrations to be tracked in a version control system.
|
|
|
|
To create a new migration run:
|
|
|
|
```bash
|
|
alembic revision --autogenerate -m 'Describe change here'
|
|
```
|
|
|
|
It's best practice to review the script post revision creation: `alembic/versions`
|
|
|
|
To apply the migration:
|
|
|
|
```bash
|
|
alembic upgrade head
|
|
```
|
|
|
|
Now you can re-check using `alembic check`
|
|
|
|
If we need to rollback use:
|
|
|
|
```bash
|
|
alembic downgrade -i
|
|
```
|