SwordElucidator/American-parliamentary-debate-society

View on GitHub
documentations/database.md

Summary

Maintainability
Test Coverage
# Database
## User
User Model should contains all the registration information of the person, and a unique foreign key of Profile.

* **text** username
* **text** password  (**TODO:** need to be check validation)
* **Time** registered_time
* **int** id
* (**TODO:** Other fileds might be needed)
* **1-1 Foreign Key Profile** profile

## Profile (**TODO:** we might not need both)
Profile Model contains all the contents  that user should see in his profile.
* **1-1 Foreign Key User** user
* (Your topics generated by Forum_topic)
* (your involved messages generated by Forum_message)
* (your signed debate generated by Debate)
* **TODO:** add more here

## Debate
* **int** id
* **Time** date
* **text** location
* **text** name
* **int** max_num (For one side)
* **Profile[int]** govs
* **Profile[int]** opps

## Forum_section
* **text** name
* (TODO)

## Forum_topic
* **int** id
* **text** title
* **Time** time
* **text** section
* **Foreign key Forum_section** section
* **Foreign key Profile** lz
* **text** contents

## Forum_reply
* **Foreign key Forum_topic** topic
* **Time** time
* **int** floor
* **Foreign Key Forum_reply** to
* **Foreign key Profile** cz
* **text** content