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

Implement tags in the database #157

Closed
f-fromont opened this issue Mar 24, 2022 · 3 comments · Fixed by #173
Closed

Implement tags in the database #157

f-fromont opened this issue Mar 24, 2022 · 3 comments · Fixed by #173
Assignees
Labels
back-end related to back-end code feature New feature urgent priority: urgent
Projects

Comments

@f-fromont
Copy link
Collaborator

f-fromont commented Mar 24, 2022

Is your feature request related to a problem? Please describe.
I want to be able to group posts based on a certain tag, or search based on the concept of tags

Describe the solution you'd like
A new model will be created for the database and backend to allow for the concept of tags

TAG
(PK) TAG_ID: INTEGER
TAG_NAME: STRING

POST_TAG
(PK) ID: INTEGER
(FK) TAG_ID: INTEGER
(FK) POST_ID: INTEGER
Constraint: Unique(TAG_ID, POST_ID)

Describe alternatives you've considered
Could just perform manual searches on all posts text to find the tag we are interested in (very inefficient)

The model could be changed slightly, but this simple method results in more rows but is easy for querying easily

Additional context
Add any other context or screenshots about the feature request here.

@f-fromont f-fromont self-assigned this Mar 24, 2022
@f-fromont f-fromont added feature New feature back-end related to back-end code urgent priority: urgent labels Mar 24, 2022
@f-fromont f-fromont added this to To do in Backend-A2 via automation Mar 24, 2022
@scorpionknifes
Copy link
Collaborator

scorpionknifes commented Mar 24, 2022

Recommend you add an ID to POST_TAG and add a constraint to Unique(TAG_ID, POST_ID).

Most UI tools remove rows by IDs, it would be better to have a primary key since the UI would be able to delete the row by ID. Without an ID the row must be removed manually with a SQL query to remove row.

@scorpionknifes
Copy link
Collaborator

LGTM

@DanilLinkov
Copy link
Collaborator

LGTM

Backend-A2 automation moved this from To do to Done Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end related to back-end code feature New feature urgent priority: urgent
Projects
Development

Successfully merging a pull request may close this issue.

3 participants