Skip to content
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

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Models for LMSCourse and LMSUser #6573

merged 2 commits into from
Aug 23, 2024

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Aug 20, 2024

@marcospri marcospri marked this pull request as ready for review August 21, 2024 08:49
@marcospri marcospri requested a review from seanh August 21, 2024 08:52

__table_args__ = (sa.UniqueConstraint("application_instance_id", "lms_course_id"),)

id: Mapped[int] = mapped_column(autoincrement=True, primary_key=True)
Copy link
Member Author

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.

id: Mapped[int] = mapped_column(autoincrement=True, primary_key=True)

tool_consumer_instance_guid: Mapped[str | None] = mapped_column(
sa.UnicodeText, index=True
Copy link
Collaborator

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?

Copy link
Member Author

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.

@marcospri marcospri changed the base branch from main to lms-course-user-migrations August 22, 2024 16:16
@marcospri marcospri force-pushed the lms-course-user-migrations branch from 6f8baa5 to 20867a3 Compare August 23, 2024 07:35
@marcospri marcospri force-pushed the lms-course-user-models branch from baa67df to 231dc8d Compare August 23, 2024 07:37
Base automatically changed from lms-course-user-migrations to main August 23, 2024 07:39
@marcospri marcospri force-pushed the lms-course-user-models branch from 231dc8d to 8881f66 Compare August 23, 2024 07:40
@marcospri marcospri merged commit 52eab2e into main Aug 23, 2024
9 checks passed
@marcospri marcospri deleted the lms-course-user-models branch August 23, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants