Extension:MirrorTools/mb queue table

The mb_rc_queue table has data pulled from Wikipedia by MirrorPullBot that is to be pushed to the local wiki by MirrorPushBot. This table is organized according to the following principles:
 * 1) Primary key (mbq_id)
 * 2) Other mirrorbot primary keys (e.g. mbq_text_id), in alphabetical order by field name
 * 3) Other mirrorbot fields (e.g. mbq_push_timestamp), in alphabetical order by field name
 * 4) Fields used in multiple tables (e.g. mbq_user), in alphabetical order by field name
 * 5) Fields used in only one table (e.g. mbq_rev_sha1), in alphabetical order by field name
 * 6) Fields not used anywhere, but which eventually might be (e.g. mbq_tags), in alphabetical order by field name

mbq_id
Primary key

mbq_text_id
. In the case of a page move or page merge event, it'll pertain to the redirect.

mbq_action
Action to take (e.g.,  ).

mbq_push_timestamp
Timestamp of original push. Empty if not pushed yet. In the case of mirrorundelete, this will be the timestamp returned by the API as when the revision was originally pushed by an import or a mirroredit.

mbq_push2_timestamp
Timestamp of second push. Empty except in case of mirrorundelete, when the revision was already in LocalWiki but wasn't remotely live. In the case of mirrorundelete, this will be the timestamp returned by the API as when it was that the revision was mirrorundeleted (i.e. toggled to remotely live).

mbq_status
Status of the row. 'needsrev' means the list=recentchanges data has been pulled, but now the prop=revision data needs to be pulled. 'needsrevs' means that 'needscomment' means the log event needs the null revision comment to be pulled. 'needsundelete' means that the revision can't be accessed until it's undeleted on the remote wiki. 'readytopush' means all necessary data has been pulled. 'pushed' means it was pushed to the local wiki. If empty, will be ignored by the pushbot.

mbq_comment
Comparable to, , and.

mbq_comment2
rev_comment of null and redirect revisions created by page moves.

mbq_deleted
Comparable to, , and.

mbq_len
Comparable to and.

mbq_log_action
Comparable to and.

mbq_log_id
Comparable to and.

mbq_log_type
Comparable to and.

mbq_minor
Comparable to and.

mbq_namespace
Comparable to and.

mbq_page_id
Comparable to and.

mbq_page_id2
page_id of the redirect page created by a page move event.

mbq_params
Comparable to and.

mbq_rev_id
Comparable to and. Stores the null revision ID in page move events.

mbq_rev_id2
Redirect rev_id for page move events.

mbq_timestamp
Comparable to, , , and.

mbq_title
Comparable to, , and.

mbq_user
Comparable to, , and.

mbq_user_text
Comparable to, , and.

mbq_rc_anon
Anon (from api rc ). Either 0 or 1. Comparable to.

mbq_rc_bot
Comparable to.

mbq_rc_id
Comparable to. For pagerestore mirrornorcedit-needsrev rows, this will be set to the rc_id of the log event.

mbq_rc_new
Comparable to.

mbq_rc_old_len
Comparable to ) (possibly unnecessary)

mbq_rc_patrolled
Comparable to.

mbq_rc_last_oldid
Comparable to. In the case of a mirrormove, it will hold the of the null revision, if we can get that info (i.e. if the page hasn't already been deleted on LocalWiki).

mbq_rc_source
Comparable to.

mbq_rc_type
Comparable to. As usual, there are five types: "edit", "new", "move", "log", and "external".

mbq_rev_content_model
Comparable to. (from api rev ).

mbq_rev_content_format
Comparable to. (from api rev ).

mbq_rev_sha1
sha1 (from api rev ). Comparable to.

mbq_page_is_redirect
Redirect (from api rc ). Either 0 or 1. Comparable to (or something). Not much use is made of it, so it's not a big deal. This is a promising candidate to be merged into some sort of mbq_params2 field.

mbq_tags
tags (from api rc ). Comparable to (or at least it's supposed to be).

Schema
mysql> describe mb_queue; ++-+--+-+-++ ++-+--+-+-++ ++-+--+-+-++ 37 rows in set (0.23 sec)
 * Field                 | Type                | Null | Key | Default | Extra          |
 * mbq_id                | int(10) unsigned    | NO   | PRI | NULL    | auto_increment |
 * mbq_text_id           | int(10) unsigned    | NO   |     | 0       |                |
 * mbq_action            | varchar(255)        | NO   |     |         |                |
 * mbq_push_timestamp    | varbinary(14)       | NO   | MUL |         |                |
 * mbq_status            | varchar(255)        | NO   |     |         |                |
 * mbq_comment           | varchar(255)        | NO   |     |         |                |
 * mbq_comment2          | varchar(255)        | NO   |     |         |                |
 * mbq_deleted           | tinyint(3) unsigned | NO   |     | 0       |                |
 * mbq_len               | int(11)             | YES  |     | NULL    |                |
 * mbq_log_action        | varbinary(255)      | YES  |     | NULL    |                |
 * mbq_log_id            | int(10) unsigned    | NO   |     | NULL    |                |
 * mbq_log_params        | blob                | YES  |     | NULL    |                |
 * mbq_log_type          | varbinary(32)       | NO   |     |         |                |
 * mbq_minor             | tinyint(3) unsigned | NO   |     | 0       |                |
 * mbq_namespace         | int(11)             | NO   |     | 0       |                |
 * mbq_page_id           | int(10) unsigned    | NO   |     | NULL    |                |
 * mbq_rev_id            | int(10) unsigned    | NO   |     | 0       |                |
 * mbq_rev_id2           | int(10) unsigned    | NO   |     | 0       |                |
 * mbq_timestamp         | varbinary(14)       | NO   |     |         |                |
 * mbq_title             | varchar(512)        | NO   |     |         |                |
 * mbq_user              | int(10) unsigned    | NO   |     | 0       |                |
 * mbq_user_text         | varchar(255)        | NO   |     | NULL    |                |
 * mbq_rc_anon           | tinyint(3) unsigned | NO   |     | 0       |                |
 * mbq_rc_bot            | tinyint(3) unsigned | NO   |     | 0       |                |
 * mbq_rc_id             | int(10) unsigned    | NO   |     | 0       |                |
 * mbq_rc_ip             | varbinary(40)       | NO   |     |         |                |
 * mbq_rc_last_oldidid   | int(10) unsigned    | NO   |     | 0       |                |
 * mbq_rc_new            | tinyint(3) unsigned | NO   |     | 0       |                |
 * mbq_rc_old_len        | int(11)             | YES  |     | NULL    |                |
 * mbq_rc_patrolled      | tinyint(3) unsigned | NO   |     | 0       |                |
 * mbq_rc_source         | varchar(16)         | NO   |     |         |                |
 * mbq_rc_type           | varbinary(255)      | YES  |     | NULL    |                |
 * mbq_rev_content_model | varbinary(32)       | YES  |     | NULL    |                |
 * mbq_rev_content_format | varbinary(64)      | YES  |     | NULL    |                |
 * mbq_rev_sha1          | varbinary(32)       | NO   |     |         |                |
 * mbq_page_is_redirect  | tinyint(3) unsigned | NO   |     | 0       |                |
 * mbq_tags              | varchar(255)        | NO   |     |         |                |