Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ To create the first tier it's similar, you just replace `create_superuser` for `

### 4.4 Database Migrations

> \[!WARNING\]
> To create the tables if you did not create the endpoints, ensure that you import the models in src/app/models/__init__.py. This step is crucial to create the new tables.

If you are using the db in docker, you need to change this in `docker-compose.yml` to run migrations:

```sh
Expand Down Expand Up @@ -737,6 +740,9 @@ class EntityDelete(BaseModel):

### 5.5 Alembic Migrations

> \[!WARNING\]
> To create the tables if you did not create the endpoints, ensure that you import the models in src/app/models/__init__.py. This step is crucial to create the new models.

Then, while in the `src` folder, run Alembic migrations:

```sh
Expand Down
5 changes: 2 additions & 3 deletions src/app/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
RedisRateLimiterSettings,
settings,
)
from .db.database import Base
from .db.database import async_engine as engine
from .db.database import Base, async_engine as engine
from .utils import cache, queue, rate_limit

from ..models import *

# -------------- database --------------
async def create_tables() -> None:
Expand Down
4 changes: 4 additions & 0 deletions src/app/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .post import Post
from .rate_limit import RateLimit
from .tier import Tier
from .user import User