F4KRP-47 Create Routes and Route Stops Table#16
Merged
eddywang4340 merged 7 commits intomainfrom Oct 11, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements database models for a route management system by creating Route and RouteStop tables with their respective SQLModel classes. The implementation establishes a one-to-many relationship between routes and route stops with cascade deletion behavior.
- Created
Routemodel with fields for route metadata (name, notes, length) and relationship to route stops - Created
RouteStopmodel with foreign key references and stop sequencing capability - Added proper model registration in the database initialization module
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| backend/python/app/models/routes.py | Defines Route model with base, table, and API models including relationship to route stops |
| backend/python/app/models/route_stops.py | Defines RouteStop model with foreign key relationships and stop sequencing |
| backend/python/app/models/init.py | Registers new models for database initialization |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ColinToft
pushed a commit
that referenced
this pull request
Oct 13, 2025
* added routes table * added route_stops table * added imports to app * fixed linter issues * fixed formatting errors * fixed import * removed route_group_id
landont168
added a commit
that referenced
this pull request
Oct 13, 2025
* Add DriverAssignment schema (#9) * Add driver_assignment schema * Register model with SQLModel * Update foreign keys to point to correct PK fields * Update tablename * F4KRP-19 | Add locations table (#10) * add `Location` model and `locations` table * Create location_groups schema + update route (#7) * Create location_groups schema * Fix linting errors in location_groups.py and __init__.py * Create location_group service * Implement PATCH /location-group/{id} route * Fix formating * Add num_locations field * Migrate num_locations to computer property * Update backend/python/app/models/location_group.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update backend/python/app/models/location_group.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Colin Toft <47548563+ColinToft@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Implemented Driver History Model (#11) * Implemented Driver History Model * Fixed Lint Issues * Addressed Comments * [F4KRP-85] Create jobs table [F4KRP-85] Create jobs table (#12) * Fix job import * create admin info table (#13) * admin info table * fixed formatting and linting issues * implemented all code review comments * Merge branch 'database-schemas' into chloe/admin-info-table * fixed formatting and linting issues * Merge branch 'database-schemas' into chloe/admin-info-table * fix linting and formatting * Merge branch 'database-schemas' into chloe/admin-info-table * fix formating errors * feat(models): add RouteGroup models and table definition (#18) * feat(models): add RouteGroup models and table definition * test-commit Co-authored-by: Yujie Meng <yujiemengca@gmail.com> * test Co-authored-by: Yujie Meng <192458226+Yujie-Meng@users.noreply.github.com> * tested patch and working, need to fix the response (#22) * done * applied copilot changes * removing unintended changes * updates to init * ? * ? * ? * Revert all __init__.py files to match database-schemas branch * work? --------- Co-authored-by: Yujie Meng <192458226+Yujie-Meng@users.noreply.github.com> Co-authored-by: Yujie <yujiemengca@gmail.com> Co-authored-by: Colin Toft <47548563+ColinToft@users.noreply.github.com> * Pranav/create drivers (#17) * implement base classes for drivers * fixed lint issues * reformat driver class * use base model * use emailStr for drivers --------- Co-authored-by: Colin Toft <47548563+ColinToft@users.noreply.github.com> * F4KRP-47 Create Routes and Route Stops Table (#16) * added routes table * added route_stops table * added imports to app * fixed linter issues * fixed formatting errors * fixed import * removed route_group_id * Create location_groups schema + update route (#7) * Create location_groups schema * Fix linting errors in location_groups.py and __init__.py * Create location_group service * Implement PATCH /location-group/{id} route * Fix formating * Add num_locations field * Migrate num_locations to computer property * Update backend/python/app/models/location_group.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update backend/python/app/models/location_group.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Colin Toft <47548563+ColinToft@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [F4KRP-85] Create jobs table [F4KRP-85] Create jobs table (#12) * Fix job import * create admin info table (#13) * admin info table * fixed formatting and linting issues * implemented all code review comments * Merge branch 'database-schemas' into chloe/admin-info-table * fixed formatting and linting issues * Merge branch 'database-schemas' into chloe/admin-info-table * fix linting and formatting * Merge branch 'database-schemas' into chloe/admin-info-table * fix formating errors * feat(models): add RouteGroup models and table definition (#18) * feat(models): add RouteGroup models and table definition * test-commit Co-authored-by: Yujie Meng <yujiemengca@gmail.com> * test Co-authored-by: Yujie Meng <192458226+Yujie-Meng@users.noreply.github.com> * tested patch and working, need to fix the response (#22) * done * applied copilot changes * removing unintended changes * updates to init * ? * ? * ? * Revert all __init__.py files to match database-schemas branch * work? --------- Co-authored-by: Yujie Meng <192458226+Yujie-Meng@users.noreply.github.com> Co-authored-by: Yujie <yujiemengca@gmail.com> Co-authored-by: Colin Toft <47548563+ColinToft@users.noreply.github.com> * Prep for migrations * migrate db * refactor validate phone function * Update backend/python/app/services/implementations/driver_service.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix driver date * delete import * fix formatting * fix typing in migration file --------- Co-authored-by: Hy Lac <121268118+kingMonkeh@users.noreply.github.com> Co-authored-by: Landon Trinh <landon.trinh@icloud.com> Co-authored-by: James <66389450+Jam-Cai@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: David Lu <151972620+ludavidca@users.noreply.github.com> Co-authored-by: Kerushani Sivaneswaran <99515111+Kerushani@users.noreply.github.com> Co-authored-by: ChloeW125 <139719503+ChloeW125@users.noreply.github.com> Co-authored-by: Tq <tqmeng123@gmail.com> Co-authored-by: Yujie Meng <192458226+Yujie-Meng@users.noreply.github.com> Co-authored-by: Yujie <yujiemengca@gmail.com> Co-authored-by: Pranav Gopinath <125942307+PranavGopinath@users.noreply.github.com> Co-authored-by: Eddy <60328364+eddywang4340@users.noreply.github.com> Co-authored-by: Landon Trinh <111808279+landont168@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notion ticket link
F4KRP-47
Implementation description
Steps to test
What should reviewers focus on?
Checklist