Rewrite Comment API
From MoodleDocs
| Rewrite Comment API | |
|---|---|
| Project state | Development in progress |
| Tracker issue | MDL-71935 |
| Discussion | https://moodle.org/mod/forum/discuss.php?d=423482 |
| Assignee | Martin Gauk and Lars Bonczek (TU Berlin, innoCampus) |
This is a project to rewrite the Comment API.
Database Structure
comments
This table keeps information about posted comments.
| Field | Type | Default | Info |
| id | int(10) | autoincrementing | |
| contextid | int(10) | the id of the context this was posted in | |
| component | varchar(100) | the plugin this comment belongs to | |
| commentarea | varchar(100) | the comment area this was posted in | |
| itemid | int(10) | the itemid this belongs to | |
| content | text | this comment's text content | |
| format | int(2) | the text format | |
| userid | int(10) | the id of the user who posted this comment | |
| usermodified | int(10) | the id of the user who last modified this comment | |
| pseudonym | varchar(100) | the pseudonym specified when the comment was posted | |
| timecreated | int(10) | the time when this comment was posted | |
| timemodified | int(10) | the time when this comment was last modified | |
| replytoid | int(10) | the id of the comment this is a reply to | |
| replies | int(10) | 0 | the number of replies to this comment |
| upvotes | int(10) | 0 | the number of upvotes on this comment |
| customdata | text | the JSON-encoded custom data associated with this comment |
comments_queue
This table keeps track of comments that will be mailed in digest form.
| Field | Type | Default | Info |
| id | int(10) | autoincrementing | |
| userid | int(10) | the id of the user to notify | |
| commentid | int(10) | the id of the comment to notify about | |
| timemodified | int(10) | the timestamp when this record was last modified |
comments_subscriptions
This table keeps track of subscriptions to comments or comment sections.
| Field | Type | Default | Info |
| id | int(10) | autoincrementing | |
| userid | int(10) | the id of the user to notify | |
| contextid | int(10) | subscribe to comments in this context | |
| component | varchar(100) | subscribe to comments belonging to this component | |
| commentarea | varchar(100) | subscribe to comments belonging to this commentarea | |
| itemid | int(10) | subscribe to comments with this itemid | |
| commentid | int(10) | subscribe to replies to this comment | |
| subscription | int(2) | the subscription type (0 off, 1 immediate, 2 digests, -1 default) | |
| timemodified | int(10) | the timestamp when this record was last modified |
comments_votes
This table keeps track of votes on comments.
| Field | Type | Default | Info |
| id | int(10) | autoincrementing | |
| userid | int(10) | the id of the user who voted | |
| commentid | int(10) | the id of the comment that was voted for | |
| vote | int(2) | the vote (0 no vote, 1 upvote) |