schema - xkylesun/jumpstarter GitHub Wiki
Database Schema
users
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
email |
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 |
name |
string | not null |
biography |
string | |
avatar |
string |
- index on
email, unique: true - index on
session_token, unique: true
projects
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
title |
string | not null, indexed |
subtitle |
string | not null |
creator_id |
integer | not null, indexed, foreign key |
category |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
due_date |
datetime | not null |
body |
text | not null |
creator_idreferencesusers- index on
[creator_id, title]unique: true - index on
category - has_one_attached: image
rewards
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
project_id |
integer | not null, indexed, foreign key |
quantity |
integer | |
minimum |
integer | not null |
title |
string | not null |
description |
string | not null |
estimated delivery |
string |
project_idreferencesprojects- index on
project_id
pledges
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
backer_id |
integer | not null, indexed, foreign key |
project_id |
integer | not null, indexed, foreign key |
reward_id |
integer | not null, indexed, foreign key |
amount |
integer | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
backer_idreferencesuserspledge_level_idreferencespledges- index on
backer_id - index on
project_id - index on
reward_id
// TBD
comments
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
author_id |
integer | not null, indexed, foreign key |
project_id |
integer | not null, indexed, foreign key |
body |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
parent_id |
integer |
author_idreferencesusersproject_idreferencesprojects- index on
author_id - index on
project_id