diff --git a/aim/cli/digifeeds.py b/aim/cli/digifeeds.py index bedf735..342fe04 100644 --- a/aim/cli/digifeeds.py +++ b/aim/cli/digifeeds.py @@ -1,4 +1,5 @@ import typer +from aim.digifeeds.database import models, main app = typer.Typer() @@ -6,3 +7,9 @@ @app.command() def add_to_db(barcode: str): print(f'Adding barcode "{barcode}" to database') + + +@app.command() +def load_statuses(): + with main.SessionLocal() as db_session: + models.load_statuses(session=db_session) diff --git a/aim/digifeeds/bin/load_statuses.py b/aim/digifeeds/bin/load_statuses.py deleted file mode 100644 index df189a2..0000000 --- a/aim/digifeeds/bin/load_statuses.py +++ /dev/null @@ -1,12 +0,0 @@ -import sys -from aim.digifeeds.database.models import load_statuses -from aim.digifeeds.database.main import SessionLocal - - -def main(): - with SessionLocal() as db_session: - load_statuses(session=db_session) - - -if __name__ == "__main__": - sys.exit(main())