ONEARMY / community-platform

A platform to build useful communities that aim to tackle global problems
https://platform.onearmy.earth
MIT License
1.14k stars 386 forks source link

Migrate Research Update collaborators property from a list with one string value to just a string. #3695

Closed pizzaisdavid closed 2 weeks ago

pizzaisdavid commented 3 months ago

As a developer, I want the database schema to be easy.

On Research Updates, the collaborators property is a list, but it should really be a string. source.

The idea:

...well, I see why we just live with this mild inconvenience.

This process could be simplified with a maintenance downtime, but I'll think about that later.

pizzaisdavid commented 3 months ago

simpler way:

The scripts could be combined.

mariojsnunes commented 3 months ago

A bit confused, you mean that for ResearchUpdate the collaborators property can be removed? If that's the case, we can simply change the code to only use the author property, deploy and then use Retool to migrate/cleanup wherever necessary. No downtime needed.

pizzaisdavid commented 3 months ago

It can't really be completely removed, but the data structure can be simplified.

What it is: image

what it could be: image

Note: in the screenshots, these are on individual Research Update Entries, not the Research Article root object (hope that terminology isn't too confusing.)

pizzaisdavid commented 3 months ago

For each Research Update Entry, there will only ever be one person given credit. Different Updates can have different creators, so individual Updates still need a field.

source

I think there is no author field currently, but that is something I made up, for this simplification. If a person makes an Update for their own Research Article, they are considered a collaborator (see screenshot above.) It kinda doesn't make sense to be a "collaborator" on your own Research Article, that's why to go for a change to "author" instead of "collaborator". But we can still show "collaborator" on the user interface.

We would still want to display all the individual people who contributed, this ticket is meant to be a refactoring that simplifies the data model.