-
Notifications
You must be signed in to change notification settings - Fork 5
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
Migrate models and schemas to SQLModels #136
Comments
Context@Oshruti see above for context and below for some actionable steps. LMK if you need help / more detail. TODO
NotesThis may not be possible to complete this sprint, but do your best! |
Due to some versioning issues seen below, it seems that implementing this right now is not best. We were already planning on upgrading Pydantic and SQLAlchemy. I'll reopen this when SQLModel gets updated (which I heard on the internet that an update was planned). @Oshruti I'll find another issue for you to work this week
|
SQLModel has gained support for our currently outdated versions of Pydantic and SQLAlchemy (See roadmap). It should be discussed whether we should migrate to SQLModel before we migrate Pydantic and SQLAlchemy. The roadmap has no timeline, so we should evaluate which dependency update would add the most value to our project. |
SQLModel is a library written by the creator of FastAPI that streamlines the process of working with SQLAlchemy models and Pydantic models. Currently our code contains both an internship model (SQLAlchemy model) and an internship schema (Pydantic model). It also contains functions to convert between the two, which have been the source of bugs (year and period issues).
SQLModel adds a class called SQLModel that is both a SQLAlchemy model and a Pydantic model. This eliminates the need for duplicate models/schemas and functions to convert between the two. This will become especially important when we add more database tables for users, tags, companies, etc.
Migration should be relatively straightforward. The most difficult part will be removing the conversion functions and seeing what breaks. Hopefully, we should be able to just ignore conversion and continue.
The text was updated successfully, but these errors were encountered: