-
-
Notifications
You must be signed in to change notification settings - Fork 883
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
Community post tags (part 1) #4997
Open
phiresky
wants to merge
7
commits into
main
Choose a base branch
from
post-tags
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+486
−28
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phiresky
requested review from
dessalines,
dullbananas,
Nutomic and
SleeplessOne1917
as code owners
September 2, 2024 16:59
Nutomic
reviewed
Sep 16, 2024
dessalines
reviewed
Sep 16, 2024
CREATE TABLE community_post_tag ( | ||
id serial PRIMARY KEY, | ||
ap_id text NOT NULL UNIQUE, | ||
community_id int NOT NULL REFERENCES community (id) ON UPDATE CASCADE ON DELETE CASCADE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this linking column, and create a new table called community_post_tag
, with a primary key of (community_id, tag_id)
. Also add a published
column
Check out any of the other bridge tables, like post_read
, community_block
, etc for examples.
dessalines
reviewed
Sep 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first part of an implementation of post tags based on LemmyNet/rfcs#4.
It implements the following:
What is missing:
I would like to propose that we work on and merge this (and potentially other larger changes) in multiple parts, as soon as each part is ready and ofc doesn't negatively affect the existing functionality. That way the branches don't live for months and diverge more and more and each chunk stays simple and can be reviewed quickly.
There's some somewhat open questions wrt this code:
community_post_tag (id, apub_id, name, url)
so it's clear this is a tag that belongs to one community and tags posts in that community. This way we can later more tag types that may have different meanings and especially different properties and access control. For exampleglobal_post_tag
for tags that are the same / interpretable globally (like NSFW). The n:m association table is calledpost_community_post_tag (post_id, tag_id)
.