XWiki Database Schema

Error: The schema below is out of date. It needs to be updated. Feel free to update it if you know what you're doing :)

Following are all of the tables that make up the XWiki database schema. Just taking a brief look at the schema's tables can give you a clue to how the underlying system works.

Note that there may be minor variances for databases other than MySQL, but if so, they have not yet been documented.

Tables

XWiki Documents

This table contains information about XWiki Documents. This is the main table.

XWiki documents are identified by XWD_WEB and XWD_NAME (see the user guide for more information about this). But for a given URL (with a unique XWD_WEB and XWD_NAME), you may find different XWiki documents because some offshoots of the original document called translations may have been added and they have been tagged with their own specific language code (e.g., "en" for English, "fr" for French). Hence, there are 2 kinds of documents in XWiki and you can think of them as 1) "regular" or "main" documents and 2) "translations" (of "main" documents). The first kind has a value of 0 in the XWD_TRANSLATION field whereas the second kind has a value of 1. If you look at the database, there should exist at most one document for each XWD_WEB and XWD_NAME combination that comes with a value of 0 for the XWD_TRANSLATION attribute. All the other documents bearing the same XWD_WEB and XWD_NAME attribute values will have a value of 1 for the XWD_TRANSLATION attribute. Of course, in practice the user doesn't have to worry about that as she would use XWiki's interface to add or remove translations and original documents. But there have been situations in which the database gets corrupted and as a result you could see 2 documents with the same values for XWD_WEB, XWD_NAME and XWD_LANGUAGE (e.g., in practice 2 "en" buttons appear on the web page and you can only access one of these translation documents from the interface, the other one is masked). If that happens to you, remove the document bearing a 1 in XWD_TRANSLATION to fix the database (or tag it as another language, "it" for example).

xwikidoc
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWD_ID BIGINT(20) db_check.gif     0  
db_field.gif XWD_FULLNAME VARCHAR(255) db_check.gif        
db_field.gif XWD_NAME VARCHAR(255)       null  
db_field.gif XWD_LANGUAGE VARCHAR(5)       null  
db_field.gif XWD_DEFAULT_LANGUAGE VARCHAR(5)       null  
db_field.gif XWD_TRANSLATION INTEGER db_check.gif     0  
db_field.gif XWD_DATE DATETIME db_check.gif     0000-00-00 00:00:00  
db_field.gif XWD_CREATION_DATE DATETIME       null  
db_field.gif XWD_AUTHOR VARCHAR(255)       null  
db_field.gif XWD_CREATOR VARCHAR(255)       null  
db_field.gif XWD_WEB VARCHAR(255) db_check.gif        
db_field.gif XWD_CONTENT MEDIUMTEXT db_check.gif        
db_field.gif XWD_ARCHIVE MEDIUMTEXT db_check.gif        
db_field.gif XWD_VERSION VARCHAR(255) db_check.gif        
db_field.gif XWD_PARENT TEXT       null  

^ back to top ^

XWiki Locks

This table contain the informations about locks of document edition.

xwikilock
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_DOC_ID BIGINT(20) db_check.gif     0  
db_field.gif XWL_AUTHOR VARCHAR(255)       null  
db_field.gif XWL_DATE DATETIME db_check.gif     0000-00-00 00:00:00  

^ back to top ^

This table contain the informations about the links of that can be parsed in each document.

xwikilinks
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_DOC_ID BIGINT(20) db_check.gif     0  
db_key.gif XWL_LINK VARCHAR(255)          
db_field.gif XWL_FULLNAME VARCHAR(255)       null  

^ back to top ^

XWiki Attachments

This table contains attachment information (not including the content and versions).

xwikiattachment
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWA_ID BIG_INT(20) db_check.gif     0  
db_field.gif XWA_DOC_ID BIG_INT(20)       null  
db_field.gif XWA_FILENAME VARCHAR(255) db_check.gif        
db_field.gif XWA_SIZE INTEGER       null  
db_field.gif XWA_DATE DATETIME db_check.gif     0000-00-00 00:00:00  
db_field.gif XWA_AUTHOR VARCHAR(255)       null  
db_field.gif XWA_VERSION VARCHAR(255) db_check.gif     null  
db_field.gif XWA_COMMENT         null  

^ back to top ^

XWiki Attachment Archive

This table stores the attachment archive in RCS format.

xwikiattachment_archive
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWA_ID BIG_INT(20) db_check.gif     0  
db_field.gif XWA_ARCHIVE MEDIUMBLOB       null  

^ back to top ^

XWiki Attachment Content

This table stores the attachment content.

xwikiattachment_content
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWA_ID BIGINT(20) db_check.gif     0  
db_field.gif XWA_CONTENT MEDIUMBLOB db_check.gif        

^ back to top ^

XWiki Classes

Warning: In XWiki 1.1M4, this table is not populated. The XWiki engine retieves the class of an object using xwikiobjects.XWO_CLASSNAME in table xwikiobjects instead. It accesses the document where xwikidoc.XWD_FULLNAME matches xwikiobjects.XWO_CLASSNAME, and then reads the XML description of the class from xwikidoc.XWD_CUSTOM_CLASS_XML.

The table xwikiobjects is still populated, of course.

This table contains the declaration of XWiki classes.

xwikiclasses
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWO_ID INTEGER db_check.gif     0 Points to xwikidoc table
db_field.gif XWO_NAME VARCHAR(255) db_check.gif        
db_field.gif XWO_CUSTOM_MAPPING TEXT       null  
db_field.gif XWO_CUSTOM_CLASS VARCHAR(255)       null  

^ back to top ^

XWiki Properties Classes

This table contains the list of properties in XWiki Classes. Each property has an entry in the type specific table.

xwikiclassesprop
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWP_ID INTEGER db_check.gif     0  
db_key.gif XWP_NAME VARCHAR(255) db_check.gif        
db_field.gif XWP_PRETTYNAME VARCHAR(255)       null  
db_field.gif XWP_CLASSTYPE VARCHAR(255)       null  
db_field.gif XWP_UNMODIFIABLE TINYINT(1)       null  
db_field.gif XWP_NUMBER INTEGER       null  

^ back to top ^

XWiki String Classes

This table contains the declaration of the strings properties in XWiki classes.

xwikistringclasses
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWS_ID INTEGER db_check.gif     0  
db_key.gif XWS_NAME VARCHAR(255) db_check.gif        
db_field.gif XWS_SIZE INTEGER       null  
db_field.gif XWS_ROWS INTEGER       null  

^ back to top ^

XWiki Boolean Classes

This table contains the declaration of the boolean properties in XWiki classes.

xwikibooleanclasses
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWN_ID INTEGER db_check.gif     0  
db_key.gif XWN_NAME VARCHAR(255) db_check.gif        
db_field.gif XWN_DISPLAYTYPE VARCHAR(20)       null

The field name prefix is this table is wrong. It should be corrected in xwiki.hbm.xml.

^ back to top ^

XWiki Date Classes

This table contains the declaration of the date properties in XWiki classes.

xwikidateclasses
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWS_ID INTEGER db_check.gif     0  
db_key.gif XWS_NAME VARCHAR(255) db_check.gif        
db_field.gif XWS_SIZE INTEGER       null  
db_field.gif XWS_EMPTY_IS_TODAY INTEGER       null  
db_field.gif XWS_DATE_FORMAT VARCHAR(255)       null  

The field name prefix is this table is wrong. It should be corrected in xwiki.hbm.xml.

^ back to top ^

XWiki Number Classes

This table contains the declaration of the number (long, integer, double, float) properties in XWiki classes.

xwikinumberclasses
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWN_ID INTEGER db_check.gif     0  
db_key.gif XWN_NAME VARCHAR(255) db_check.gif     null   
db_field.gif XWN_SIZE INTEGER db_check.gif     null  
db_field.gif XWN_NUMBERTYPE VARCHAR(20)       null  

^ back to top ^

XWiki List Classes

This table contains the declaration of the list properties in XWiki classes.

xwikislistclasses
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_ID INTEGER db_check.gif     0  
db_key.gif XWL_NAME VARCHAR(255) db_check.gif        
db_field.gif XWL_DISPLAYTYPE VARCHAR(20)       null  
db_field.gif XWL_MULTISELECT TINYINT(1)       null  
db_field.gif XWL_SIZE INTEGER       null  
db_field.gif XWL_RELATIONAL TINYINT(1)       null  
db_field.gif XWL_VALUES TEXT       null  

^ back to top ^

XWiki Database List Classes

This table contains the declaration of the database list properties in XWiki classes.

xwikidblistclasses
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_ID INTEGER db_check.gif     0  
db_key.gif XWL_NAME VARCHAR(255) db_check.gif        
db_field.gif XWL_DISPLAYTYPE VARCHAR(20)       null  
db_field.gif XWL_MULTISELECT TINYINT(1)       null  
db_field.gif XWL_SIZE INTEGER       null  
db_field.gif XWL_RELATIONAL TINYINT(1)       null  
db_field.gif XWL_SQL TEXT       null  

^ back to top ^

XWiki Objects

This table contains the list of XWiki Objects. Objects can have properties, as declared by their class.

xwikiobjects
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWO_ID INTEGER db_check.gif     0  
db_field.gif XWO_NUMBER INTEGER       null   
db_field.gif XWO_NAME VARCHAR(255) db_check.gif     null  
db_field.gif XWO_CLASSNAME VARCHAR(255) db_check.gif        

^ back to top ^

XWiki Properties

This table contains the list of properties in XWiki Objects. Each property has an entry in the type specific table.

xwikiproperties
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWP_ID INTEGER db_check.gif     0  
db_key.gif XWP_NAME VARCHAR(255) db_check.gif        
db_field.gif XWP_CLASSTYPE VARCHAR(255)       null  

^ back to top ^

XWiki Strings

This table contains the string data from XWiki Objects.

xwikistrings
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWS_ID INTEGER db_check.gif     0  
db_key.gif XWS_NAME VARCHAR(255) db_check.gif        
db_field.gif XWS_VALUE VARCHAR(255)       null  

^ back to top ^

XWiki Large Strings

This table contain the data for textarea properties in XWiki Objects.

xwikilargestrings
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_ID INTEGER db_check.gif     0  
db_key.gif XWL_NAME VARCHAR(255) db_check.gif        
db_field.gif XWL_VALUE TEXT       null  

^ back to top ^

XWiki Dates

This table contains the data of date properties in XWiki objects.

xwikidates
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWS_ID INTEGER db_check.gif     0  
db_key.gif XWS_NAME VARCHAR(255) db_check.gif        
db_field.gif XWS_VALUE DATETIME       null  

The field name prefix is this table is wrong. It should be corrected in xwiki.hbm.xml.

^ back to top ^

XWiki Doubles

This table contain the data for double properties in XWiki Objects.

xwikidoubles
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWD_ID INTEGER db_check.gif     0  
db_key.gif XWD_NAME VARCHAR(255) db_check.gif        
db_field.gif XWD_VALUE DOUBLE       null  

^ back to top ^

XWiki Floats

This table contain the data for floats properties in XWiki Objects.

xwikifloats
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWF_ID INTEGER db_check.gif     0  
db_key.gif XWF_NAME VARCHAR(255) db_check.gif        
db_field.gif XWF_VALUE FLOAT       null  

^ back to top ^

XWiki Integers

This table contain the data for integer properties in XWiki Objects.

xwikiintegers
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWI_ID INTEGER db_check.gif     0  
db_key.gif XWI_NAME VARCHAR(255) db_check.gif        
db_field.gif XWI_VALUE INTEGER       null  

^ back to top ^

XWiki Longs

This table contain the data for long properties in XWiki Objects.

xwikilongs
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_ID INTEGER db_check.gif     0  
db_key.gif XWL_NAME VARCHAR(255) db_check.gif        
db_field.gif XWL_VALUE BIGINT(20)       null  

^ back to top ^

XWiki List Items

This table contain the data for lists properties in XWiki Objects.

xwikilistitems
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_ID INTEGER db_check.gif     0  
db_key.gif XWL_NAME VARCHAR(255) db_check.gif        
db_field.gif XWL_VALUE VARCHAR(255)       null  
db_key.gif XWL_NUMBER INTEGER db_check.gif     0  

^ back to top ^

XWiki Lists

This table contain the data for lists properties in XWiki Objects.

xwikilists
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWL_ID INTEGER db_check.gif     0  
db_key.gif XWL_NAME VARCHAR(255) db_check.gif        

^ back to top ^

Statistics

XWiki Document Stats

This table contain stats information, namely page/space/wiki views and edits .

xwikistatsdoc
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWS_ID INTEGER db_check.gif     0  
db_field.gif XWS_NUMBER INTEGER       null   
db_field.gif XWS_NAME VARCHAR(255) db_check.gif        
db_field.gif XWS_CLASSNAME VARCHAR(255) db_check.gif        
db_field.gif XWS_ACTION VARCHAR(255) db_check.gif        
db_field.gif XWS_PAGE_VIEWS INTEGER       null  
db_field.gif XWS_UNIQUE_VISITORS INTEGER       null  
db_field.gif XWS_PERIOD INTEGER       null  
db_field.gif XWS_VISITS INTEGER       null  

^ back to top ^

XWiki Referer Stats

This page contains the incoming externa links on the Wiki.

xwikistatsreferer
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWR_ID INTEGER db_check.gif     0  
db_field.gif XWR_NUMBER INTEGER       null  
db_field.gif XWR_NAME VARCHAR(255) db_check.gif        
db_field.gif XWR_CLASSNAME VARCHAR(255) db_check.gif        
db_field.gif XWR_REFERER VARCHAR(255) db_check.gif        
db_field.gif XWR_PAGE_VIEWS INTEGER       null  
db_field.gif XWR_PERIOD INTEGER       null  

^ back to top ^

XWiki Visits

This table contains the sessions of the named users.

xwikistatsvisit
  Column Name Datatype Not null auto inc flags Default Value Comments
db_key.gif XWV_ID INTEGER db_check.gif     0  
db_field.gif XWV_NUMBER INTEGER       null   
db_field.gif XWV_NAME VARCHAR(255) db_check.gif        
db_field.gif XWV_CLASSNAME VARCHAR(255) db_check.gif        
db_field.gif XWV_IP VARCHAR(32) db_check.gif        
db_field.gif XWV_USER_AGENT VARCHAR(255) db_check.gif        
db_field.gif XWV_COOKIE VARCHAR(255) db_check.gif        
db_field.gif XWV_UNIQUE_ID VARCHAR(255) db_check.gif        
db_field.gif XWV_PAGE_VIEWS INTEGER       null  
db_field.gif XWV_SAVES INTEGER       null  
db_field.gif XWV_DOWNLOADS INTEGER       null  
db_field.gif XWV_START_DATE DATETIME       null  
db_field.gif XWV_END_DATE DATETIME       null  

^ back to top ^

Version 42.1 last modified by VincentMassol on 23/04/2008 at 08:45

Comments 0

No comments for this document

Attachments 3

Image
db_check.gif 1.2
PostedBy: VincentMassol on 06/12/2007 (221 bytes )
Image
db_key.gif 1.2
PostedBy: VincentMassol on 06/12/2007 (228 bytes )
Image
db_field.gif 1.2
PostedBy: VincentMassol on 06/12/2007 (226 bytes )

Creator: VincentMassol on 2006/12/05 14:27
This wiki is licensed under a Creative Commons license
1.4.1.10194