-
Notifications
You must be signed in to change notification settings - Fork 1
Postgres Database Schema
jas-singh-code edited this page Mar 9, 2021
·
26 revisions
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
username | string | not null, indexed, unique |
string | not null, indexed, unique | |
password_digest | string | not null |
session_token | string | not null, indexed, unique |
created_at | datetime | not null |
updated_at | datetime | not null |
- has_many posts
- has_many likes
- has_many posts
- has_many friends
- has_one wall
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
title | string | not null |
message | text | not null |
wall_id | integer | not null, indexed, foreign key |
poster_id | integer | not null, indexed, foreign key |
liker_id | integer | not null, indexed, foreign key |
commenter_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
body | text | not null |
author_id | integer | not null, foreign key |
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | not null, indexed, foreign key |
comment_id | integer | not null ,indexed, foreign key |
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
owner_id | integer | not null, indexed, foreign key |
friend_id | integer | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |