Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 8, 2023
1 parent a4edea1 commit 13e449e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/src/alembic/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Thus, use the below commands with a DB generated by the main branch, then switch

Run `alembic check` to see if a migration needs to be generated.

Run `alembic revision --autogenerate -m "short description"` to generate a migration file.
Run `alembic revision --autogenerate -m "short description"` to generate a migration file.
6 changes: 4 additions & 2 deletions backend/src/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os

from alembic.command import upgrade
from alembic.config import Config
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
Expand All @@ -10,8 +12,6 @@
from psycopg2.errors import UniqueViolation
from sqlalchemy.exc import IntegrityError
from uvicorn.main import uvicorn
from alembic.command import upgrade
from alembic.config import Config

from app.core.startup import startup # isort: skip

Expand Down Expand Up @@ -276,9 +276,11 @@ def main() -> None:
reload=False,
)


def migrate_database() -> None:
config = Config("alembic.ini")
upgrade(config, "head")


if __name__ == "__main__":
main()

0 comments on commit 13e449e

Please sign in to comment.