Schema:submissions

From ISFDB
Revision as of 09:55, 6 March 2020 by Ahasuerus (talk | contribs) (Added affected_record_id; updated the list of supported values of the submission state field)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Schema Summary

+--------------------+-----------------------+------+-----+---------+----------------+
| Field              | Type                  | Null | Key | Default | Extra          |
+--------------------+-----------------------+------+-----+---------+----------------+
| sub_id             | int(11)               | NO   | PRI | NULL    | auto_increment |
| sub_state          | enum('N','R','I','P') | YES  | MUL | NULL    |                |
| sub_type           | int(11)               | YES  |     | NULL    |                |
| sub_data           | mediumtext            | YES  |     | NULL    |                |
| sub_time           | datetime              | YES  |     | NULL    |                |
| sub_reviewed       | datetime              | YES  | MUL | NULL    |                |
| sub_submitter      | int(11)               | NO   |     | 0       |                |
| sub_reviewer       | int(11)               | NO   | MUL | 0       |                |
| sub_reason         | mediumtext            | YES  |     | NULL    |                |
| sub_holdid         | int(11)               | NO   |     | 0       |                |
| affected_record_id | int(11)               | YES  | MUL | NULL    |                |
+--------------------+-----------------------+------+-----+---------+----------------+

Description

The submission table holds XML records of new, updated, and deleted ISFDB records. The format of the XML records can be found in the article Data Submission Formats.

  • sub_id - Unique record ID for the submissions table.
  • sub_state - Submission state code. The currently supported submissions state codes are:
    • "I": "Integrated", i.e. "Approved"
    • "N": "New"
    • "P": "In Progress or Errored Out"
    • "R": "Rejected"
  • When a submission is created and added to this table, the value of this field is set to "N". When the submission approval process starts, the value of this field is set to "P". When the submission approval process completes, the value of this field is set to "I". If a submission is rejected by a moderator, the value of this field is set to "R".
  • sub_type - Numeric code of the submission type. The current list of supported submission types and their numeric values can be found in module common/isfdb.py starting with MOD_AUTHOR_MERGE (1)
  • sub_data - The XML string of the submission.
  • sub_time - Date and time of the submission.
  • sub_reviewed - Date and time when the submission was approved or rejected.
  • sub_submitter - User ID of the submitter. Pointer to mw_user.
  • sub_reviewer - User ID of the reviewer. Pointer to mw_user.
  • sub_reason - The reason why the submission was rejected.
  • sub_holdid - User ID of the moderator who placed the submission on hold. Pointer to mw_user.
  • affected_record_id - Record ID of the database record which was created or affected by this submission. Currently only a few submission types populate this field.