User Table
Description: Stores user information.Relationships
- Sessions: A user can have multiple sessions.
- Posts: A user can create multiple posts.
- Following: A user can follow other users.
- Followers: A user can be followed by other users.
Session Table
Description: Stores session information for users.Relationships
- User: Each session is associated with one user.
Post Table
Description: Stores posts created by users.Relationships
- User: Each post is created by one user.
- Original Post: Posts can reference other posts as the original post.
- Parent Post: Posts can reference other posts as the parent post.
- Children: A post can have multiple child posts.
- Media: Posts can have multiple media attachments.
- Notifications: Posts can trigger notifications.
- Links: Posts may have multiple links.
Post Child Table
Description: Stores the relationships between parent and child posts.Relationships
- Parent Post: Each child record references a parent post.
- Child Post: Each child record references a child post.
Post Media Table
Description: Stores media attachments for posts.Relationships
- Post: Each media record is associated with one post.
Follow Table
Description: Stores follow relationships between users.Relationships
- Follower: Each follow record references a follower user.
- Followed: Each follow record references a followed user.
Notification Table
Description: Stores notifications for users.Relationships
- User: Each notification is associated with the user who receives it.
- Actor: Each notification references the user who triggered it.
- Post: Each notification can be associated with a post.
Link Table
Description: Stores metadata for links shared in posts.Relationships
- Post Links: A link can be associated with multiple posts.
Post Link Table
Description: Associates links with posts.Relationships
- Post: Each post link record is associated with one post.
- User: Each post link record is associated with one user.
- Link: Each post link record references one link.
Report Table
Description: Stores reports made by users.Relationships
- Reporter: Each report is associated with the user who made it.
- Target User: Each report is associated with the user being reported.
- Target Post: A report may be associated with a specific post.
- Report Actions: A report can have multiple actions taken on it.
Report Reason & Status Enums
Refer to Enum & JSON list for more info
Report Action Table
Description: Stores actions taken on reports.Relationships
- Report: Each report action is associated with one report.
- Admin: Each report action is associated with the admin who took the action.
Notes and Warnings
- Ensure data integrity by using foreign key constraints to maintain relationships between tables.
- Be cautious with
uniqueanduniqueIndexconstraints to avoid duplication issues. - Use appropriate data types for timestamps and enums to ensure compatibility and correct representation.
