-
Notifications
You must be signed in to change notification settings - Fork 1
Database Structure
YuichiroSato edited this page Sep 27, 2014
·
10 revisions
This page explains the database structure of the Archelon.
Archelon's database name is archelon. It contains following tables.
- User Table
- Main Category Table
- Sub Category Table
- Discussion Table
User table name is user. It contains following columns.
| Column | Type | Length | Null | Note |
|---|---|---|---|---|
| id | BIGINT | 20 | NG | Auto Increment |
| state | INT | 2 | NG | Active, Inactive, Banned, Withdrew |
| name | VARCHAR | 64 | NG | |
| VARCHAR | 64 | NG | ||
| password | VARCHAR | 64 | NG | SHA-256 hashed value |
| description | TEXT | OK | ||
| birthdate | DATE | OK | ||
| location | VARCHAR | 64 | OK | |
| affiliate | VARCHAR | 64 | OK | |
| url | VARCHAR | 64 | OK | |
| twitter_id | VARCHAR | 20 | OK | |
| twitter_token | VARCHAR | 255 | OK | |
| twitter_secret | VARCHAR | 255 | OK | |
| facebook_id | VARCHAR | 64 | OK | |
| facebook_token | VARCHAR | 255 | OK | |
| facebook_secret | VARCHAR | 255 | OK |
User table name is category_main. It contains following columns.
| Column | Type | Length | Null | Note |
|---|---|---|---|---|
| id | INT | 11 | NG | Auto Increment |
| name | VARCHAR | 64 | NG | message bundle key |
User table name is category_sub. It contains following columns.
| Column | Type | Length | Null | Note |
|---|---|---|---|---|
| id | INT | 11 | NG | Auto Increment |
| main_id | INT | 11 | NG | Auto Increment |
| name | VARCHAR | 64 | NG | message bundle key |
Discussion table name is discussion. It contains following columns.
| Column | Type | Length | Null | Note |
|---|---|---|---|---|
| id | BIGINT | 20 | NG | Auto Increment |
| author_id | BIGINT | 20 | NG | Reference User ID |
| category_id | INT | 11 | NG | Sub category id |
| state | INT | 2 | NG | Active, Inactive, Solved, Closed |
| create_time | TIMESTAMP | NG | ||
| update_time | TIMESTAMP | OK | ||
| subject | VARCHAR | 64 | NG | |
| participants | INT | 11 | NG | Number of participants |
| posts | INT | 11 | NG | Number of posts |
NOTE: Discussion contents are placed in MongoDB.
Discussion content is a POJO (Plain Old Java Object), it can convert for JSON format automatically.
| Field | Type | Null | Note |
|---|---|---|---|
| _id | String | NG | MongoDB Object ID |
| discussionId | String | NG | |
| subject | String | NG | |
| posts | List | NG | |
| participants | List | NG |
| Field | Type | Null | Note |
|---|---|---|---|
| authorId | long | OK | |
| description | String | NG | |
| math | String | OK | |
| fig | String | OK | |
| svg | String | OK |