Skip to content
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

Closed
wants to merge 23 commits into from
Closed

Conversation

cl0ete
Copy link
Collaborator

@cl0ete cl0ete commented Sep 26, 2024

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

@cl0ete cl0ete self-assigned this Sep 26, 2024
@cl0ete cl0ete changed the title Alembic bootstrap the db ➕🗃️Alembic bootstrap the db Sep 26, 2024
@cl0ete cl0ete force-pushed the alembic-bootstrap-the-db branch 2 times, most recently from 073af2c to 19f3de9 Compare October 9, 2024 11:13
@cl0ete cl0ete marked this pull request as ready for review October 9, 2024 11:16
@cl0ete cl0ete marked this pull request as draft October 9, 2024 11:44
trustregistry/tests/test_main.py Fixed Show fixed Hide fixed
trustregistry/tests/test_main.py Fixed Show fixed Hide fixed
trustregistry/tests/test_main.py Fixed Show fixed Hide fixed
trustregistry/tests/test_main.py Fixed Show fixed Hide fixed
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
@cl0ete cl0ete force-pushed the alembic-bootstrap-the-db branch from f7f901a to 1ba3605 Compare October 11, 2024 08:06
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
db_url = os.environ.get("POSTGRES_DATABASE_URL")

if db_url:
logger.debug(f"Using database URL from environment")

Check warning

Code scanning / Prospector (reported by Codacy)

f-string is missing placeholders (F541) Warning

f-string is missing placeholders (F541)
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

Using an f-string that does not have any interpolated variables
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

'sqlalchemy.exc.ProgrammingError' imported but unused (F401)
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

Unused ProgrammingError imported from sqlalchemy.exc
@@ -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

Redefining name 'engine' from outer scope (line 17)
Copy link

sonarcloud bot commented Oct 11, 2024

@@ -2,10 +2,11 @@

import pytest
from fastapi import FastAPI
from sqlalchemy.exc import ProgrammingError

Check notice

Code scanning / Pylintpython3 (reported by Codacy)

Unused ProgrammingError imported from sqlalchemy.exc Note test

Unused ProgrammingError imported from sqlalchemy.exc
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
trustregistry/tests/test_main.py Dismissed Show dismissed Hide dismissed
@cl0ete
Copy link
Collaborator Author

cl0ete commented Oct 14, 2024

Added in PR983

@cl0ete cl0ete closed this Oct 14, 2024
@cl0ete cl0ete deleted the alembic-bootstrap-the-db branch October 14, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant