0x3F-Lab / love-letters

Agile Web Dev Project
4 stars 0 forks source link

Figure out database schema #22

Closed Connor2803 closed 2 months ago

Connor2803 commented 3 months ago

Decide on what we want to store in the database, and how to split it up into their own tables.

Alex-Hawking commented 3 months ago

Image

Alex-Hawking commented 2 months ago

@Mitan4E @Connor2803 can we attach the schema to this issue pls

Connor2803 commented 2 months ago

Users Table user_id: A unique identifier for each user (Primary Key). first_name: The user's first name. last_name: The user's last name. gender: The user's gender. email: The user's email address, which must be unique. password hash: users password hashed phone_number: The user's phone number. socials: A text field that can store links to social media profiles or any other user social identifiers.

Posts Table: post_id: A unique identifier for each post (Primary Key). user_id: The ID of the user who made the post (Foreign Key from Users table). title: The title of the post. is_anonymous: is the post anonymous content: The content/description of the post. post_type: A type indicator for the post (e.g., 'friend', 'more', 'search'). created_at: A timestamp of when the post was created. Replies Table: This will store user replies to posts.

Replies table: reply_id: A unique identifier for each reply (Primary Key). post_id: The ID of the post that the reply is for (Foreign Key from Posts table). user_id: The ID of the user who made the reply (Foreign Key from Users table). content: The content of the reply. created_at: A timestamp of when the reply was created.

Connor2803 commented 2 months ago

Implemented this schema.