27 lines
351 B
Markdown
27 lines
351 B
Markdown
|
# RatBot
|
||
|
|
||
|
```
|
||
|
alembic init alembic
|
||
|
```
|
||
|
|
||
|
In alembic.ini, configure the database URL:
|
||
|
```ini
|
||
|
sqlalchemy.url = sqlite:///./test.db
|
||
|
```
|
||
|
|
||
|
`albemic/env.py`
|
||
|
```python
|
||
|
from models import Base
|
||
|
target_metadata = Base.metadata
|
||
|
```
|
||
|
|
||
|
**Make migrations**
|
||
|
```zsh
|
||
|
alembic revision --autogenerate -m "Create model XYZ"
|
||
|
```
|
||
|
|
||
|
**Migrate**
|
||
|
```zsh
|
||
|
alembic upgrade head
|
||
|
```
|