-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
Shawn edited this page May 10, 2019
·
4 revisions
| Column Name | Date Type | Content |
|---|---|---|
id |
integer | primary key, auto increment |
username |
string | not null |
first_name |
string | |
password_digest |
string | not null |
session_token |
string | not null |
- index: username, unique
{
"_id": "1",
"username": "Bison",
"first_name": "Shawn",
"password_digest": "3489sjtkl4jts894ik5jt",
"session_token": "384s8if4jtiowj4tsgf98u4i",
"date_created": "5/12/2018",
"date_updated": "7/22/2018",
"children": [{
"_id": "2",
"username": "Scout",
"first_name": "Scout"
},{
"_id": "3",
"username": "Sky",
"first_name": "Sky"
}]
}
{
"_id": "2",
"username": "Scout",
"first_name": "Scout",
"password_digest": "3489sjtkl4jts894ik5jt",
"session_token": "384s8if4jtiowj4tsgf98u4i",
"date_created": "5/12/2018",
"date_updated": "7/22/2018",
"children": []
}
{
"_id": "3",
"username": "Sky",
"first_name": "Sky",
"password_digest": "3489sjtkl4jts894ik5jt",
"session_token": "384s8if4jtiowj4tsgf98u4i",
"date_created": "5/12/2018",
"date_updated": "7/22/2018",
"children": []
}| Column Name | Date Type | Content |
|---|---|---|
id |
integer | primary key, auto increment |
title |
string | not null |
body |
text | not null |
amount |
float | not null |
parent_id |
integer | not null |
child_id |
integer | |
repeating |
string | default: one-time |
deadline |
date |
- index: child_id, parent_id
- Foreign Key:
child_idbelongs to users - Foreign Key:
parent_idbelongs to users
{
"_id": "1",
"title": "clean room",
"body": ["make bed", "pick up toys"],
"amount": "1.25",
"parent": "Bison",
"child": "Scout",
"repeating": "daily",
"deadline": "",
"date_created"; "3/11/2019",
"date_updated": "5/8/2019",
}
{
"_id": "2",
"title": "Do baby stuff",
"body": ["smile", "play"],
"amount": "0",
"parent": "Bison",
"child": "Sky",
"repeating": "daily",
"deadline": "",
"date_created"; "3/11/2019",
"date_updated": "5/8/2019",
}| Column Name | Date Type | Content |
|---|---|---|
id |
integer | primary key, auto increment |
parent_id |
integer | not null |
child_id |
string | not null |
balance_owed |
float | not null |
- index: parent_id, child_id
- Foreign Key:
parent_idbelongs to users - Foreign Key:
child_idbelongs to users
Not needed
| Column Name | Date Type | Content |
|---|---|---|
id |
integer | primary key, auto increment |
child_id |
integer | not null |
amount |
float | not null |
- index: child_id
- Foreign Key:
child_idbelongs to users
{
"_id": "1",
"parent": "Bison",
"child": "Scout",
"amount": "5"
}
{
"_id": "2",
"parent": "Bison",
"child": "Scout",
"amount": "3.50"
}Team: Shawn Scott, Grant Paulson, Sean Kennealy, Vu Tran