Skip to content

Database Schema

DanielLaV edited this page Dec 10, 2021 · 5 revisions

Users

column name data type detail
id integer not null, primary key
username string not null, unique
passwordHash binary not null
firstName string not null
lastName string not null
about text
profileImage string
created_at timestamp not null

Stories

column name data type detail
id integer not null, primary key
authorId integer not null, foreign key
title string not null
likes integer not null

Comments

column name data type detail
id integer not null, primary key
userId integer not null, foreign key
storyId integer not null, foreign key
content text

Likes

column name data type detail
likeId integer not null, primary key
storyId integer not null, foreign key
commentId integer not null, foreign key
userId integer not null, foreign key

Relationships

column name data type detail
followId integer not null, primary key
followingUserId integer not null, foreign key
followerUserId integer not null, foreign key

##StoryToTopics

column name data type detail
storyId integer not null, primary key
categoryId integer not null, foreign key

CategoriesTopics

column name data type detail
id integer not null, primary key
name string not null

Clone this wiki locally