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

Improve database layout for core.Journalist #40

Open
anibalpacheco opened this issue Aug 27, 2024 · 0 comments
Open

Improve database layout for core.Journalist #40

anibalpacheco opened this issue Aug 27, 2024 · 0 comments

Comments

@anibalpacheco
Copy link
Contributor

anibalpacheco commented Aug 27, 2024

Soon we will introduce new fields to store the Journalist profile URL in many more social networks, a large number of Journalists with a low number of profile links defined will produce an inefficient storage result (table with mostly null values in its cells), the proposal here is to use a new model SocialNetwork with all the columns we want, but 2 of these must be: "order" (to present profile links in that order) and "enabled" (to enable/disable the render of profiles links of the social network). Then, a M2M relation implemented with a new field in core.Journalist: social_networks = ManyToMany(SocialNetwork, through=SocialNetworkProfileLink) through another new model (SocialNetworkProfileLink) with a single not nullable profile_url = URLField field to store the profile link of the relation.

For the Journalist model admin implemenation change, use a tabular inline with no extra rows (new blank rows to fill will only appear when its button or link is clicked)

Important: the solution must come also with the data migration script to migrate existing data to the new layout

@anibalpacheco anibalpacheco changed the title Improve darabase layout for core.Journalist Improve database layout for core.Journalist Aug 27, 2024
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

No branches or pull requests

1 participant