DB Schema - fbeilke/Thermos GitHub Wiki

Thermos database schema

Users

Table users {
id INTEGER PK,
email VARCHAR(50) unique,
blog_name VARCHAR(100) unique,
hashed_password VARCHAR(100),
profile_picture_url VARCHAR unique,
created_at DATETIME,
updated_at DATETIME
}

Posts

Table posts {
id INTEGER PK,
title VARCHAR,
content VARCHAR, caption VARCHAR,
user_id INTEGER FK references users.id,
total_likes INTEGER,
tags VARCHAR,
post_type VARCHAR,
created_at DATETIME,
updated_at DATETIME
}

Reblogs

Table reblogs {
id INTEGER PK,
user_id INTEGER FK references users.id,
post_id INTEGER FK references posts.id,
comment_content VARCHAR,
tags VARCHAR,
post_type VARCHAR,
reblogged_from INTEGER FK references users.id,
created_at DATETIME,
updated_at DATETIME
}

Likes

Table likes {
id INTEGER PK,
user_id INTEGER FK references users.id,
post_id INTEGER FK references posts.id,
reblog_id INTEGER FK references reblogs.id,
created_at DATETIME,
updated_at DATETIME
}

Follows

Table follows {
id INTEGER PK,
followers INTEGER FK references users.id,
following INTEGER FK references users.id,
created_at DATETIME,
updated_at DATETIME
}