Labs/Joey/database

< Labs‎ | Joey
Revision as of 17:52, 18 May 2007 by Clouserw (talk | contribs)

Joey » Database

Schema Diagram (png)

Schema SQL (txt)

Field descriptions

users

+------------------+------------------+------+-----+---------+----------------+
| Field            | Description                                              |
+------------------+------------------+------+-----+---------+----------------+
| id               |                                                          |
| username         |                                                          |
| password         |                                                          |
| email            |                                                          |
| confirmationcode | If needed to confirm email, it's used.  Otherwise, null. |
| phone_id         |                                                          |
| operator_id      |                                                          |
| phonenumber      |                                                          |
| notes            |                                                          |
| disabled         |                                                          |
| created          |                                                          |
| modified         |                                                          |
+------------------+------------------+------+-----+---------+----------------+

operators

+-------------+------------------+------+-----+---------+-------------+
| Field       | Description                                           |
+-------------+------------------+------+-----+---------+-------------+
| id          |                                                       |
| provider    | Name of the provider (eg. T-Mobile, Nextel, etc.)     |
| emaildomain | The domain+tld if email SMS is supported              |
| created     |                                                       |
| modified    |                                                       |
+----------+------------------+------+-----+---------+----------------+


uploads

+----------+------------------+------+-----+---------+----------------+
| Field    | Description                                              |
+----------+------------------+------+-----+---------+----------------+
| id       |                                                          |
| user_id  |                                                          |
| title    | Defaults to referrer title, can be modified              |
| referrer | The source URL that this object was uploaded from        |
| created  |                                                          |
| modified |                                                          |
+----------+------------------+------+-----+---------+----------------+

files

+-----------+------------------+------+-----+---------+----------------+
| Field     | Description
+-----------+------------------+------+-----+---------+----------------+
| id        |                                                          |
| upload_id |                                                          |
| name      | The filename on disk                                     |
| size      | The size of the file on disk                             |
| type      | The type of the file (eg. image/png)                     |
| preview   | The filename of the preview on disk (always an image/png)|
| created   |                                                          |
| modified  |                                                          |
+-----------+------------------+------+-----+---------+----------------+


contentsources

+----------------------+------------------+------+-----+---------+-------+
| Field                | Description                                     |
+----------------------+------------------+------+-----+---------+-------+
| id                   |                                                 |
| upload_id            |                                                 |
| source               | Textual representation. Can be XML, a URL, etc. |
| contentsourcetype_id |                                                 |
| created              |                                                 |
| modified             |                                                 |
+----------------------+------------------+------+-----+---------+-------+

This table gets a bonus explanation. The `source` column is basically a pointer to information elsewhere on the web. As the project grows, the types of content (specified in `contentsourcetypes`) in this field can grow. The two supported types right now are microsummaries (XML) and RSS (URL).

contentsourcetypes

+----------+------------------+------+-----+---------+-----+
| Field    | Description                                   |
+----------+------------------+------+-----+---------+-----+
| id       |                                               |
| name     | The type of content (eg. application/rss+xml) |
| created  |                                               |
| modified |                                               |
+----------+------------------+------+-----+---------+-----+


phones

+----------+-------------------+
| Field    | Description       |
+----------+-------------------+
| id       |                   |
| name     | Name of the phone |
| created  |                   |
| modified |                   |
+----------+-------------------+

This is a table that will hold information about phones. It will expand as we get more information on the phones. If a phone doesn't exist, there will be a "generic" type with some safe defaults.