Database Schema - Paul-Ryan/catstarter GitHub Wiki
Database Schema
project | Data Type | Description | Notes |
---|---|---|---|
id | integer | not null | primary_key |
title | string | not null, unique | |
blurb | text | not null | |
description | text | not null | |
author_id | integer | not null | indexed, foreign_key: users |
due_date | date | not null | |
funding_goal | integer | not null | |
image_url | string | not null |
category_names | Data Type | Description | Notes |
---|---|---|---|
id | integer | not null | primary_key |
name | string | not null, unique |
categories | Data Type | Description | Notes |
---|---|---|---|
project_id | integer | not null | indexed, foreign_key: projects |
category_id | integer | not null | indexed, foreign_key: category_names |
users | Data Type | Description | Notes |
---|---|---|---|
id | integer | not null | primary key |
username | string | not null, unique | indexed |
password_digest | string | not null | |
string | not null, unique | indexed | |
session_token | string | not null, unique | indexed |
rewards | Data Type | Description | Notes |
---|---|---|---|
id | integer | not null | primary_key |
project_id | integer | not null | foreign_key: project |
title | string | not null | |
description | integer | not null | |
reward_minimum_amount | integer | not null |
pledges | Data Type | Description | Notes |
---|---|---|---|
id | integer | not null | primary_key |
user_id | integer | not null | foreign_key: users |
project_id | integer | not null | foreign_key: projects |
pledge_amount | integer | not null | not null |
reward_ownership | Data Type | Description | Notes |
---|---|---|---|
id | integer | not null | primary_key |
reward_id | integer | not null | foreign_key: rewards |
pledge_id | integer | not null | foreign_key: pledges |