-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
MBS-1801 (I): SQL additions to support in-site social aspects #2108
Open
reosarevok
wants to merge
1
commit into
metabrainz:master
Choose a base branch
from
reosarevok:MBS-1801
base: master
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.
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
mwiencek
reviewed
May 19, 2021
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.
This looks really good overall. I think the indexes are fine, but we can always tweak them later if not.
This adds five tables to their own messaging namespace. message is for user-to-user messages - as such, it has a sender and a receiver, plus a title and content. It also has an optional parent column which will store the previous message when there is a message thread. hidden_message allows for either the sender or receiver (or both) to "remove" a message from their messaging list. This is less complex than removing the message outright (on demand from which of the users?) and makes sure that the content is available to an admin to verify abuse without the user needing to keep the abusive message in their inbox. notification is for system notifications. These could be implemented as messages from ModBot, but having them in a separate table seems simpler since we are likely to want to display them separately. It also makes it easier to deal with them separately if we decide to, for example, make notifications be removed some time after being read. In preparation for such a possibility, "read" is a timestamp for notification, but just a boolean for message where we expect to only remove (hide) messages on request by the sender or receiver. edit_thanks and edit_note_thanks allow editors to thank others for their edits and edit notes, respectively. The thanking itself is stored in these tables, and I expect it should be possible for a user to check all their sent or received thanks later on. The user being thanked should also be notified, so on a new thanking a notification should be inserted in the notification table. Whether this will happen via a trigger or through code can be decided later.
mwiencek
approved these changes
May 20, 2021
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.
Implement MBS-1801
This adds five tables to their own messaging namespace.
message
is for user-to-user messages - as such, it has a sender and a receiver, plus a title and content. It also has an optionalparent column which will store the previous message when there is a message thread.
hidden_message
allows for either the sender or receiver (or both) to "remove" a message from their messaging list. This is less complex than removing the message outright (on demand from which of the users?) and makes sure that the content is available to an admin to verify abuse without the user needing to keep the abusive message in their inbox.notification
is for system notifications. These could be implemented as messages from ModBot, but having them in a separate table seems simpler since we are likely to want to display them separately. It also makes it easier to deal with them separately if we decide to, for example, make notifications be removed some time after being read.In preparation for such a possibility,
read
is a timestamp fornotification
, but just a boolean formessage
where we expect to only remove (hide) messages on request by the sender or receiver.edit_thanks
andedit_note_thanks
allow editors to thank others for their edits and edit notes, respectively. The thanking itselfis stored in these tables, and I expect it should be possible for a user to check all their sent or received thanks later on.
The user being thanked should also be notified, so on a new thanking a notification should be inserted in the notification table. Whether this will happen via a trigger or through code can be decided later.