Difference between revisions of "Database Schema"

From ISFDB
Jump to navigation Jump to search
(→‎Publication-Related Tables: +3 identifier tables)
(28 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
This page lists all MySQL tables used by the ISFDB software and links to more detailed pages which provide a field-level view of each table.
 +
 
==Introduction==
 
==Introduction==
  
There are three primary document views utilized by the ISFDB: showing the bibliography of an author, showing the titles present in a publication, and showing the publications in which a title was published. These views require three primary tables: authors, titles, and publications. Various normalization tables are provided to reduce errors and storage needs.
+
The ISFDB is built around the following types of records:
  
The illustration below shows the relationship between the various tables. All notes are stored in the notes table, which other tables refer to via the primary note_id key. There are two tables which are used for administrative and display purposes. The metadata table contains data pertinent to the database itself, while the magazine table contains information that allows magazine publication to be grouped under a single magazine heading.
+
* authors, which include editors and artists
 +
* publications, i.e. any separate appearances of SF-related works, mostly books and magazines
 +
* titles, i.e. separate works of fiction, non-fiction and art which can appear in one or more publications
 +
* series, i.e. groups of related titles
 +
* publishers
 +
* publication series, that is otherwise unrelated publications grouped together by the publisher, e.g. ''Ace Double''
 +
* awards
  
A high-level explanation of the database can be found in the [[Database Overview]] article. An up to date diagram of the ISFDB tables and their relationships can be found [http://www.isfdb.org/isfdb_schema.png here].
+
Note that all notes are stored in the notes table, which other tables refer to via the primary note_id key. The metadata table contains data pertinent to the database itself.
 +
 
 +
A high-level explanation of the database can be found in the [[Database Overview]] article (out of date.) An out-of-date diagram of the ISFDB tables and their relationships can be found [http://www.isfdb.org/isfdb_schema.png here].
  
 
==Global Tables==
 
==Global Tables==
Line 11: Line 21:
 
Information stored in the global tables are shared across the title, author, and publication related tables in the ISFDB.
 
Information stored in the global tables are shared across the title, author, and publication related tables in the ISFDB.
  
* [[Schema:metadata]] - Contains metadata about the database itself.
+
* [[Schema:directory]] - Author directory information.
 +
* [[Schema:history]] - Tracks database change history (partial implementation.)
 +
* [[Schema:languages]] - List of all languages supported by the ISFDB. Must be kept in sync with LANGUAGES in common/isfdb.py.
 +
* [[Schema:license_keys]] - User license key information.
 +
* [[Schema:metadata]] - Metadata about the database itself.
 
* [[Schema:notes]] - General-purpose notes area.
 
* [[Schema:notes]] - General-purpose notes area.
* [[Schema:submissions]] - Table for storing data submissions.
+
* [[Schema:submissions]] - Data submissions.
* [[Schema:history]] - Tracks database change history.
+
* [[Schema:webpages]] - URLs of other Web sites. Used by authors, publishers, publication series, titles, series, award categories and award types.
* [[Schema:directory]] - Holds author directory information.
 
* [[Schema:license_keys]] - Holds user license key information.
 
  
 +
== User Tables==
 +
* [[Schema:user_languages‎]] - User Language preferences.
 +
* [[Schema:user_preferences]] - User preferences.
 +
* [[Schema:user_sites]] - User Website preferences.
 +
* [[Schema:changed_verified_pubs]] - Changes to primary-verified publications
 +
* [[Schema:user_status]] - User status information
 +
 +
== MediaWiki Tables==
 +
 +
The ISFDB uses MediaWiki software to run its Wiki. See [https://upload.wikimedia.org/wikipedia/commons/f/f7/MediaWiki_1.24.1_database_schema.svg this MediaWiki chart for lists of table fields]. The following MediaWiki pages are also used by the ISFDB software:
 +
 +
* '''mw_page''' - Information about all Wiki pages. Used by the nightly cleanup reports to find Wiki-ISFDB mismatches.
 +
* '''mw_user‎''' - User ID, name and other user-specific information. The version in publicly available backups has been cleansed of all private data.
 +
* '''mw_user‎_group''' - Includes the Wiki group (editors, moderators/sysops or bureaucrats) to which each user belongs.
  
 
==Author-Related Tables==
 
==Author-Related Tables==
Line 28: Line 54:
 
* [[Schema:pseudonyms]] - Table of pseudonyms.
 
* [[Schema:pseudonyms]] - Table of pseudonyms.
 
* [[Schema:pub_authors]] - Links author records to publication records.
 
* [[Schema:pub_authors]] - Links author records to publication records.
* [[Schema:webpages]] - Specialized table for storing webpage URLs. Originally for Author Webpages, now also for Publication Series and Titles.
 
  
 
==Publication-Related Tables==
 
==Publication-Related Tables==
Line 34: Line 59:
 
The following tables are used to store information about publications:
 
The following tables are used to store information about publications:
  
* [[Schema:magazine]] - Contains magazine information. Will be deleted in near future.
+
* [[Schema:identifier_types]] - Contains information on external identifier types.
 +
* [[Schema:identifier_sites]] - Contains information on Web sites for external identifier types.
 +
* [[Schema:identifiers]] - Contains information on external identifiers.
 +
* [[Schema:magazine]] - Contains magazine information. '''Unused'''.
 +
* [[Schema:primary_verifications]] - Contains primary verification information for a specific publication.
 +
* [[Schema:pub_content]] - Links title records to a specific publication.
 +
* [[Schema:pub_series]] - Contains information on a publication series.
 
* [[Schema:publishers]] - Contains publisher information.
 
* [[Schema:publishers]] - Contains publisher information.
 
* [[Schema:pubs]] - Contains information on a specific publication.
 
* [[Schema:pubs]] - Contains information on a specific publication.
* [[Schema:pub_content]] - Links title records to a specific publication.
+
* [[Schema:reference]] - Contains information on secondary verification references.
* [[Schema:verification]] - Contains verification information for a specific publication.
+
* [[Schema:verification]] - Contains secondary verification information for a specific publication.
* [[Schema:reference]] - Contains information on verification references.
+
* [[Schema:websites]] - Third party (bookseller and bibliographic) sites that a publication may link to based on its ISBN.
 
 
  
 
==Title-Related Tables==
 
==Title-Related Tables==
Line 47: Line 77:
  
 
* [[Schema:series]] - Contains series information.
 
* [[Schema:series]] - Contains series information.
 +
* [[Schema:tag_mapping]] - Links a tags entry to a specific title per user.
 +
* [[Schema:tags]] - Contains user-defined title tags.
 +
* [[Schema:title_relationships]] - Maps relationship between a review, serial, or translations to a title.
 
* [[Schema:titles]] - Contains information about a specific title.
 
* [[Schema:titles]] - Contains information about a specific title.
* [[Schema:title_relationships]] - Maps relationship between a review, serial, or translations to a title.
 
* [[Schema:tags]] - Contains user-defined title tags.
 
* [[Schema:tag_mapping]] - Links a tags entry to a specific title per user.
 
 
* [[Schema:votes]] - Tracks votes for a specific title per user.
 
* [[Schema:votes]] - Tracks votes for a specific title per user.
  
Line 57: Line 87:
 
The following tables are used to store information about awards:
 
The following tables are used to store information about awards:
  
 +
* [[Schema:award_cats]] - Contains information about award categories.
 +
* [[Schema:award_types]] - Contains information about award types.
 
* [[Schema:awards]] - Contains award information.
 
* [[Schema:awards]] - Contains award information.
* [[Schema:title_awards]] - Maps an award to a specific title.
+
* [[Schema:title_awards]] - Links award records to their related title records.
 +
 
 +
==Transliteration Tables==
 +
 
 +
* [[Schema:trans_authors]] - Transliterated canonical names for authors
 +
* [[Schema:trans_legal_names]] - Transliterated legal names for authors
 +
* [[Schema:trans_pub_series]] - Transliterated names for publication series
 +
* [[Schema:trans_publisher]] - Transliterated names for publishers
 +
* [[Schema:trans_pubs]] - Transliterated titles for publications
 +
* [[Schema:trans_titles]] - Transliterated titles for title records
 +
 
 +
==Data Cleanup Tables==
 +
 
 +
* [[Schema:bad_images]] - Publication IDs with suspect images
 +
* [[Schema:cleanup]] - Record IDs in need of review and potential cleanup
 +
* [[Schema:missing_author_urls]] - Author mismatches between ISFDB and other sites (SFE3 only at this time)

Revision as of 19:16, 25 May 2017

This page lists all MySQL tables used by the ISFDB software and links to more detailed pages which provide a field-level view of each table.

Introduction

The ISFDB is built around the following types of records:

  • authors, which include editors and artists
  • publications, i.e. any separate appearances of SF-related works, mostly books and magazines
  • titles, i.e. separate works of fiction, non-fiction and art which can appear in one or more publications
  • series, i.e. groups of related titles
  • publishers
  • publication series, that is otherwise unrelated publications grouped together by the publisher, e.g. Ace Double
  • awards

Note that all notes are stored in the notes table, which other tables refer to via the primary note_id key. The metadata table contains data pertinent to the database itself.

A high-level explanation of the database can be found in the Database Overview article (out of date.) An out-of-date diagram of the ISFDB tables and their relationships can be found here.

Global Tables

Information stored in the global tables are shared across the title, author, and publication related tables in the ISFDB.

User Tables

MediaWiki Tables

The ISFDB uses MediaWiki software to run its Wiki. See this MediaWiki chart for lists of table fields. The following MediaWiki pages are also used by the ISFDB software:

  • mw_page - Information about all Wiki pages. Used by the nightly cleanup reports to find Wiki-ISFDB mismatches.
  • mw_user‎ - User ID, name and other user-specific information. The version in publicly available backups has been cleansed of all private data.
  • mw_user‎_group - Includes the Wiki group (editors, moderators/sysops or bureaucrats) to which each user belongs.

Author-Related Tables

The following tables are used to store information about authors and their works:

Publication-Related Tables

The following tables are used to store information about publications:

Title-Related Tables

The following tables are used to store information about titles:

Awards-Related Tables

The following tables are used to store information about awards:

Transliteration Tables

Data Cleanup Tables