I have a FastAPI + tortose projects and I want to run the project locally with database postgres://lom:lom@localhost:5432/lom (database is created)
My code
# lom/app.py
class App:
storage: S3Storage
def __init__(self):
self.config = Config(_env_file=".env", _env_file_encoding="utf-8")
self.__setup_sentry()
...
def create_app(self, loop: asyncio.AbstractEventLoop) -> FastAPI:
app = FastAPI()
register_tortoise(
app,
modules={
"models": [
"lom.core",
"aerich.models",
]
}
I want to apply current migrations and create new migrations I am trying
aerich init -t <Don't understand path>
What aerich command should I run and which parameters should I use?
├── lom
│ ├── app.py
│ ├── config.py
│ ├── core
│ │ ├── city.py
│ │ ├── company.py
├──
├── migrations
│ ├── 001_main.sql
│ ├── 002_cities.sql
│ ├── 003_cities_declination.sql
from How to create db migrations for local tortoise project?
No comments:
Post a Comment