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

Upsert rows in LMSCourse and LMSUser #6576

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Upsert rows in LMSCourse and LMSUser #6576

merged 2 commits into from
Aug 23, 2024

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Aug 21, 2024

For:

Testing

docker compose exec postgres psql -U postgres -c "select * from lms_user;"
 id | tool_consumer_instance_guid |               lti_user_id                |                      h_userid                       |             email             |     display_name     |          created           |          updated          
----+-----------------------------+------------------------------------------+-----------------------------------------------------+-------------------------------+----------------------+----------------------------+---------------------------
  1 |                             | 969fc294ee26e3f1d0c9714af3351dc4eacfd6df | acct:[email protected] | [email protected] | DISPLAY NAME TEACHER | 2024-08-21 08:50:32.597965 | 2024-08-21 08:50:37.46538
(1 row)
docker compose exec postgres psql -U postgres -c "select * from lms_course;"
 id |             tool_consumer_instance_guid             |              lti_context_id              |         h_authority_provided_id          | copied_from_id |                              name                               |          created           |          updated           
----+-----------------------------------------------------+------------------------------------------+------------------------------------------+----------------+-----------------------------------------------------------------+----------------------------+----------------------------
  1 | VCSy8DAKCFIQYaItpSGyXhOXIlk5A6NWduVVG1u3:canvas-lms | f8b6b49524384ef0d8ed02fabeab2911e54c448e | 605f1929b64070bc5e34a6aae5a3bf9f0b227ff3 |                | Developer Test Course with "Allow Include Parameters" Unchecked | 2024-08-21 08:50:32.597965 | 2024-08-21 08:50:32.597965
(1 row)

@marcospri marcospri requested a review from seanh August 21, 2024 08:53
@marcospri marcospri marked this pull request as ready for review August 21, 2024 08:53
@@ -0,0 +1,286 @@
"""Create the lms_course and lms_user tables."""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be rebased out, here for easier testing.

@@ -243,6 +278,7 @@ def test_upsert_course_sets_canvas_sections_enabled_based_on_legacy_rows(
type_=Any(),
copied_from=None,
)
bulk_upsert.assert_called()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test deals with something that's irrelevant in the current LMSCourse model. Just asserting that we are still calling the upsert.

I don't think we should migrate setting/extra as it exists now on Grouping but rather create columns for the information there.

We can do that one bit at a time once we have the basic structure in place.

@marcospri marcospri force-pushed the lms-course-user-models branch 2 times, most recently from 231dc8d to 8881f66 Compare August 23, 2024 07:40
Base automatically changed from lms-course-user-models to main August 23, 2024 08:05
Before doing a migration to backfill LMSUser based on the information on
User start making the code aware of both types while writing to the
DB.
Before doing a migration to backfill LMSCourse based on the information on
Course/Grouping start making the code aware of both types while writing to the
DB.
@marcospri marcospri merged commit a0d1d28 into main Aug 23, 2024
9 checks passed
@marcospri marcospri deleted the upsert-new-tables branch August 23, 2024 08:32
Copy link

sentry-io bot commented Aug 23, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ IntegrityError: (psycopg2.errors.ForeignKeyViolation) insert or update on table "lms_course" violates foreign key... lti_launches View Issue

Did you find this useful? React with a 👍 or 👎

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