Database Schema
This document provides an overview of the database schema used in the project. The database schema defines the structure of the database, including tables, columns, and relationships between tables.
Tables
Users
id
: Primary key, integerusername
: Unique, stringemail
: Unique, stringpassword
: Stringcreated_at
: Timestampupdated_at
: Timestamp
Posts
id
: Primary key, integeruser_id
: Foreign key, integertitle
: Stringcontent
: Textcreated_at
: Timestampupdated_at
: Timestamp
Comments
id
: Primary key, integerpost_id
: Foreign key, integeruser_id
: Foreign key, integercontent
: Textcreated_at
: Timestampupdated_at
: Timestamp
Relationships
- A user can have multiple posts.
- A post can have multiple comments.
- A comment belongs to a single post and a single user.