-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
➕🗃️Alembic bootstrap the db #1073
Conversation
073af2c
to
19f3de9
Compare
f7f901a
to
1ba3605
Compare
db_url = os.environ.get("POSTGRES_DATABASE_URL") | ||
|
||
if db_url: | ||
logger.debug(f"Using database URL from environment") |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Using an f-string that does not have any interpolated variables Note
from fastapi import Depends, FastAPI | ||
from scalar_fastapi import get_scalar_api_reference | ||
from sqlalchemy import inspect | ||
from sqlalchemy.engine import Engine | ||
from sqlalchemy.exc import ProgrammingError |
Check warning
Code scanning / Prospector (reported by Codacy)
'sqlalchemy.exc.ProgrammingError' imported but unused (F401) Warning
from fastapi import Depends, FastAPI | ||
from scalar_fastapi import get_scalar_api_reference | ||
from sqlalchemy import inspect | ||
from sqlalchemy.engine import Engine | ||
from sqlalchemy.exc import ProgrammingError |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Unused ProgrammingError imported from sqlalchemy.exc Note
@@ -19,10 +25,53 @@ | |||
ROOT_PATH = os.getenv("ROOT_PATH", "") | |||
|
|||
|
|||
def check_migrations( | |||
engine: Engine, alembic_cfg: Config |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Redefining name 'engine' from outer scope (line 17) Note
Quality Gate passedIssues Measures |
Added in PR983 |
Add alembic
Create initial migration that will bootstrap the tables (actors and schemas)
Modify
main.py
alembic runs the migrations on startup, start with initial migration to create tables