update README.md
This commit is contained in:
parent
6f5a9ab78c
commit
79b7ae343a
11
README.md
11
README.md
@ -223,6 +223,17 @@ can make the following steps:
|
|||||||
|
|
||||||
Note that these actions is safe, also you can do that to reset your migrations if your migration files is too many.
|
Note that these actions is safe, also you can do that to reset your migrations if your migration files is too many.
|
||||||
|
|
||||||
|
## Use `aerich` in application
|
||||||
|
|
||||||
|
You can use `aerich` out of cli by use `Command` class.
|
||||||
|
|
||||||
|
```python
|
||||||
|
from aerich import Command
|
||||||
|
|
||||||
|
command = Command(tortoise_config=config, app='models')
|
||||||
|
await command.migrate('test')
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the
|
This project is licensed under the
|
||||||
|
@ -117,7 +117,7 @@ class Command:
|
|||||||
inspect = InspectDb(connection, tables)
|
inspect = InspectDb(connection, tables)
|
||||||
await inspect.inspect()
|
await inspect.inspect()
|
||||||
|
|
||||||
async def migrate(self, name: str):
|
async def migrate(self, name: str = "update"):
|
||||||
return await Migrate.migrate(name)
|
return await Migrate.migrate(name)
|
||||||
|
|
||||||
async def init_db(self, safe: bool):
|
async def init_db(self, safe: bool):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user