Skip to content

Commit 8ee187d

Browse files
authored
Eddie/callsign upgrade (#642)
# Purpose Closes #634 . Click to open! # New Changes - Replaced the old callsign csv with the one containing all data - Extended AROUserCallsigns table to accommodate added fields - Refactored callsigns.py to parse all values of csv - Created migrate.py in backend directory to serve as the data migration command handler with input validation - Created alembic migration file for callsign table Call ```python3 gs/backend/migrate.py``` to migrate all data. Call ```python3 gs/backend/migrate.py callsigns``` or ```python3 gs/backend/migrate.py commands``` to migrate only callsigns or only main commands respectively. # Testing Explain tests that you ran to verify code functionality. - [x] I have unit-tested this PR. Otherwise, explain why it cannot be unit-tested. See screenshots below. - [x] I have included screenshots of the tests performed below. <img width="695" height="159" alt="Screenshot 2025-11-22 at 6 37 09 PM" src="https://github.com/user-attachments/assets/b35dca92-86a4-46c7-b4f6-4a5bca9701be" /> <img width="1275" height="237" alt="Screenshot 2025-11-22 at 6 39 01 PM" src="https://github.com/user-attachments/assets/95d1968b-1d58-42d5-a944-ceca379b770f" /> # Outstanding Changes If there are non-critical changes (i.e. additional features) that can be made to this feature in the future, indicate them here. Someone please create a migration guide, took me a while to figure it out.
1 parent 832f005 commit 8ee187d

File tree

7 files changed

+91000
-90889
lines changed

7 files changed

+91000
-90889
lines changed

gs/backend/api/lifespan.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from fastapi_cache.backends.inmemory import InMemoryBackend
77

88
from gs.backend.data.database.engine import get_db_session, setup_database
9-
from gs.backend.data.resources.utils import add_callsigns, add_main_commands
109

1110

1211
@asynccontextmanager
@@ -18,6 +17,4 @@ async def lifespan(_: FastAPI) -> AsyncGenerator[None, None]:
1817
# Must all the get_db_session each time when pass it into a separate function.
1918
# Otherwise, will get transaction is inactive error
2019
setup_database(get_db_session())
21-
add_main_commands(get_db_session())
22-
add_callsigns(get_db_session())
2320
yield

0 commit comments

Comments
 (0)