lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Add local column to actions tables

Open dullbananas opened this issue 8 months ago • 2 comments

The column would be true if the person is local, i.e. if the action came from the local instance. This would make some joins and/or sub-selects unnecessary, and it's consistent with other tables. If this really is an improvement, then I will make the necessary changes to uplete, so it can handle a column that is both outside of the key and not null even after removing all actions.

https://github.com/LemmyNet/lemmy/pull/5616#discussion_r2070695597

dullbananas avatar May 02 '25 02:05 dullbananas

Wouldn't it be much easier to just do a periodic job (it could even be daily), to clear out empty actions rows, rather than adding all this special uplete logic?

The empty rows are harmless anyway (since front ends will have to check that column), and space is the only consideration there. That can easily be solved by a job that scans the tables where all those columns are empty and deletes them.

dessalines avatar May 06 '25 14:05 dessalines

A local column can lead to confusion as its not immediately clear eg in community_actions whether it refers to the community or the person. Better to name it person_local, then we can also add community_local later if needed.

Nutomic avatar Jun 20 '25 08:06 Nutomic