Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README
create_db.php
wikitrust.sql
wikitrust_remove.sql

README

The script create_db.php now handles both table creation and removal.

To create tables:
./create_db.php "path_to_mediawiki" "mysql_root_user_name"

To remove tables:
./create_db.php "path_to_mediawiki" "mysql_root_user_name" remove

For example, if mediawiki is at /usr/share/mediawiki and the root user is root, 
One would use

./create_db.php /usr/share/mediawiki root

to create the tables, and 

./create_db.php /usr/share/mediawiki root remove

to remove the files.

DATABASE SCHEMA:

mysql> describe wikitrust_colored_markup;
+--------------------+-------------+------+-----+---------+-------+
| Field              | Type        | Null | Key | Default | Extra |
+--------------------+-------------+------+-----+---------+-------+
| revision_id        | int(11)     | NO   | PRI | NULL    |       | 
| revision_text      | longtext    | NO   |     | NULL    |       | 
| revision_createdon | varchar(32) | NO   | MUL | NULL    |       | 
+--------------------+-------------+------+-----+---------+-------+

Stores the trust-colored wiki-markup of revisions.


mysql> describe wikitrust_global;
+--------+-------+------+-----+---------+-------+
| Field  | Type  | Null | Key | Default | Extra |
+--------+-------+------+-----+---------+-------+
| median | float | YES  |     | NULL    |       | 
| rep_0  | float | YES  |     | NULL    |       | 
| rep_1  | float | YES  |     | NULL    |       | 
| rep_2  | float | YES  |     | NULL    |       | 
| rep_3  | float | YES  |     | NULL    |       | 
| rep_4  | float | YES  |     | NULL    |       | 
| rep_5  | float | YES  |     | NULL    |       | 
| rep_6  | float | YES  |     | NULL    |       | 
| rep_7  | float | YES  |     | NULL    |       | 
| rep_8  | float | YES  |     | NULL    |       | 
| rep_9  | float | YES  |     | NULL    |       | 
+--------+-------+------+-----+---------+-------+

Global values used throughout the wikitrust application.


mysql> describe wikitrust_missing_revs;
+--------------+----------------------------------------------+------+-----+-------------------+-------+
| Field        | Type                                         | Null | Key | Default           | Extra |
+--------------+----------------------------------------------+------+-----+-------------------+-------+
| revision_id  | int(11)                                      | NO   | PRI | NULL              |       | 
| page_id      | int(11)                                      | NO   |     | NULL              |       | 
| page_title   | varchar(255)                                 | NO   |     | NULL              |       | 
| rev_time     | varchar(255)                                 | NO   |     | NULL              |       | 
| user_id      | int(11)                                      | NO   |     | NULL              |       | 
| requested_on | timestamp                                    | NO   |     | CURRENT_TIMESTAMP |       | 
| processed    | enum('unprocessed','processing','processed') | YES  |     | unprocessed       |       | 
+--------------+----------------------------------------------+------+-----+-------------------+-------+

This table keeps a list of revisions to be processed. 
Note that there are 3 states a rev can be in, defined in the processed table.
Also, note tha that the requested_on datatype is the MySQL timestamp, NOT the 
mediawiki one.

mysql> describe wikitrust_page;
+----------------+----------+------+-----+---------+-------+
| Field          | Type     | Null | Key | Default | Extra |
+----------------+----------+------+-----+---------+-------+
| page_id        | int(11)  | NO   | PRI | NULL    |       | 
| deleted_chunks | longtext | YES  |     | NULL    |       | 
| page_info      | text     | NO   |     | NULL    |       | 
+----------------+----------+------+-----+---------+-------+

Internally used processing infomation about a page.

mysql> describe wikitrust_revision;
+------------------+---------------------+------+-----+---------+-------+
| Field            | Type                | Null | Key | Default | Extra |
+------------------+---------------------+------+-----+---------+-------+
| revision_id      | int(11)             | NO   | PRI | NULL    |       | 
| page_id          | int(11)             | YES  |     | NULL    |       | 
| text_id          | int(11)             | YES  |     | NULL    |       | 
| time_string      | binary(14)          | YES  |     | NULL    |       | 
| user_id          | int(11)             | YES  |     | NULL    |       | 
| username         | varchar(255)        | YES  |     | NULL    |       | 
| is_minor         | tinyint(3) unsigned | YES  |     | NULL    |       | 
| comment          | tinyblob            | YES  |     | NULL    |       | 
| quality_info     | text                | NO   |     | NULL    |       | 
| reputation_delta | float               | YES  |     | 0       |       | 
| overall_trust    | float               | YES  |     | 0       |       | 
+------------------+---------------------+------+-----+---------+-------+

This is cloned data from the revision table.

mysql> describe wikitrust_sigs;
+---------------+----------+------+-----+---------+-------+
| Field         | Type     | Null | Key | Default | Extra |
+---------------+----------+------+-----+---------+-------+
| revision_id   | int(11)  | NO   | PRI | NULL    |       | 
| revision_data | longtext | NO   |     | NULL    |       | 
+---------------+----------+------+-----+---------+-------+

Internally used processeing informaion about a revision.

mysql> describe wikitrust_user;
+----------+---------+------+-----+---------+-------+
| Field    | Type    | Null | Key | Default | Extra |
+----------+---------+------+-----+---------+-------+
| user_id  | int(11) | NO   | PRI | NULL    |       | 
| user_rep | float   | YES  |     | 0       |       | 
+----------+---------+------+-----+---------+-------+

Information about users -- ie, current user reputations.

mysql> describe wikitrust_vote;
+-------------+-------------+------+-----+---------+-------+
| Field       | Type        | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| revision_id | int(11)     | NO   | PRI | NULL    |       | 
| page_id     | int(11)     | NO   |     | NULL    |       | 
| voter_id    | int(11)     | NO   | PRI | NULL    |       | 
| voted_on    | varchar(32) | NO   | MUL | NULL    |       | 
| processed   | tinyint(1)  | YES  |     | 0       |       | 
+-------------+-------------+------+-----+---------+-------+

Holds votes which have been submitted but not yet processed.