Skip to content

Remove unnecessary user field from geotag #1820

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

Merged
merged 2 commits into from
Mar 14, 2025
Merged

Conversation

alastair
Copy link
Member

@alastair alastair commented Jan 31, 2025

Issue(s)
Fixes #1036

Description
The geotag.user field just replicated the same value that was in sound.user, no need to keep it.

This PR additionally moves the relation between a sound and a geotag from the sound table to the geotag table. Because not all sounds have a geotag, we had a column which was 95% null. By adding a geotag.sound_id column to the geotag table, we can remove an entire column from Sound.
The sound_id field is marked as unique, so we can still only have one tag per sound and the query to join the two tables is more or less the same

Deployment steps:
Includes migration

@alastair alastair force-pushed the geotag-remove-user branch from edd3b37 to a782795 Compare March 3, 2025 15:20
@alastair alastair force-pushed the geotag-remove-user branch from a782795 to 2dfc90d Compare March 14, 2025 15:30
Only a very small proportion of sounds have a geotag, and there can only
be one geotag per sound. Therefore it makes more sense to put a sound
reference on the geotag instead of a geotag on the sound model which is
almost always null. This should reduce the size of the sounds table
@alastair alastair force-pushed the geotag-remove-user branch from 2dfc90d to b6c2021 Compare March 14, 2025 15:41
@alastair alastair merged commit f50cb20 into master Mar 14, 2025
1 check passed
@alastair alastair deleted the geotag-remove-user branch March 14, 2025 15:46
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.

Remove GeoTag.user
1 participant