-
Notifications
You must be signed in to change notification settings - Fork 15
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
Models for LMSCourse and LMSUser #6573
Conversation
|
||
__table_args__ = (sa.UniqueConstraint("application_instance_id", "lms_course_id"),) | ||
|
||
id: Mapped[int] = mapped_column(autoincrement=True, primary_key=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to resist the temptation to make composed primark keys in table like this, (application_instance_id, lms_course_id) is a great PK now but it prevents any easy modifications of the table.
lms/models/lms_course.py
Outdated
id: Mapped[int] = mapped_column(autoincrement=True, primary_key=True) | ||
|
||
tool_consumer_instance_guid: Mapped[str | None] = mapped_column( | ||
sa.UnicodeText, index=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you actually need the sa.UnicodeText
when already using Mapped[str]
? I think SQLAlchemy chooses the right type automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we can settle on the type chosen by SQLAlchemy for str.
There's many types it could chose String, Unicode, UnicdeText, it chooses the equivalent of String/Unicode which we use in many columns. I think we can settle on that.
6f8baa5
to
20867a3
Compare
baa67df
to
231dc8d
Compare
231dc8d
to
8881f66
Compare
See:
For:
Migration for these over: