Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

define MiVideo table relationships #183

Closed
1 task done
zqian opened this issue May 27, 2020 · 5 comments · Fixed by #194
Closed
1 task done

define MiVideo table relationships #183

zqian opened this issue May 27, 2020 · 5 comments · Fixed by #194
Assignees

Comments

@zqian
Copy link
Member

zqian commented May 27, 2020

MiVideo tables need foreign key relationships to ensure data integrity.

For example:

  • mivideo_media_created.id → mivideo_media_courses.media_id

Update: This had been discussed by @ssciolla, @lsloan, and others in the past. It was determined that relationships between MiVideo and other tables would break when updates were made, causing errors. As Sam notes below, it makes sense to establish the relationship between mivideo_media_created and mivideo_media_courses.

@ssciolla
Copy link
Contributor

@zqian, establishing foreign keys from MiVideo to the Canvas data tables cannot yet be done easily because we are dropping records in inventory and MiVideo does not. If we switch to an update (or upsert) approach for Canvas tables, we can probably make this happen. In this respect, this issue is a duplicate of #162.

However, you are right that we are missing a foreign key between mivideo_media_created and mivideo_media_courses. This can and should be added.

@lsloan
Copy link
Member

lsloan commented Jun 2, 2020

@zqian, I've updated the issue description above. Of the two examples you gave, @ssciolla and I agree that relationships between MiVideo tables can be maintained. However, other relationships are problematic. If you have any other relationships to suggest, please add them to the list in the description.

@zqian
Copy link
Member Author

zqian commented Jun 5, 2020

Thanks for the suggestions, @ssciolla and @lsloan. I removed the original FK proposal

@lsloan lsloan changed the title need to define foreign key relationships for MiVideo tables define relationships between MiVideo tables Jun 10, 2020
@lsloan lsloan changed the title define relationships between MiVideo tables define MiVideo table relationships Jun 10, 2020
@lsloan lsloan added 📈 enhancement New feature or request and removed 🐛 bug Something isn't working labels Jun 10, 2020
@lsloan
Copy link
Member

lsloan commented Jun 10, 2020

I removed the "bug" label because the definition of that label is "Something isn't working". In this case, it is working. This would be an enhancement, so I've added that label.

lsloan added a commit to lsloan/course-inventory that referenced this issue Jun 10, 2020
lsloan added a commit to lsloan/course-inventory that referenced this issue Jun 10, 2020
@zqian
Copy link
Member Author

zqian commented Jun 16, 2020

verified the added FK in local MySQL instance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants