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 |
 |
XWD_ID |
BIGINT(20) |
 |
|
|
0 |
|
 |
XWD_FULLNAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWD_NAME |
VARCHAR(255) |
|
|
|
null |
|
 |
XWD_LANGUAGE |
VARCHAR(5) |
|
|
|
null |
|
 |
XWD_DEFAULT_LANGUAGE |
VARCHAR(5) |
|
|
|
null |
|
 |
XWD_TRANSLATION |
INTEGER |
 |
|
|
0 |
|
 |
XWD_DATE |
DATETIME |
 |
|
|
0000-00-00 00:00:00 |
|
 |
XWD_CREATION_DATE |
DATETIME |
|
|
|
null |
|
 |
XWD_AUTHOR |
VARCHAR(255) |
|
|
|
null |
|
 |
XWD_CREATOR |
VARCHAR(255) |
|
|
|
null |
|
 |
XWD_WEB |
VARCHAR(255) |
 |
|
|
|
|
 |
XWD_CONTENT |
MEDIUMTEXT |
 |
|
|
|
|
 |
XWD_ARCHIVE |
MEDIUMTEXT |
 |
|
|
|
|
 |
XWD_VERSION |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWL_DOC_ID |
BIGINT(20) |
 |
|
|
0 |
|
 |
XWL_AUTHOR |
VARCHAR(255) |
|
|
|
null |
|
 |
XWL_DATE |
DATETIME |
 |
|
|
0000-00-00 00:00:00 |
|
^ back to top ^
XWiki Links
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 |
 |
XWL_DOC_ID |
BIGINT(20) |
 |
|
|
0 |
|
 |
XWL_LINK |
VARCHAR(255) |
|
|
|
|
|
 |
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 |
 |
XWA_ID |
BIG_INT(20) |
 |
|
|
0 |
|
 |
XWA_DOC_ID |
BIG_INT(20) |
|
|
|
null |
|
 |
XWA_FILENAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWA_SIZE |
INTEGER |
|
|
|
null |
|
 |
XWA_DATE |
DATETIME |
 |
|
|
0000-00-00 00:00:00 |
|
 |
XWA_AUTHOR |
VARCHAR(255) |
|
|
|
null |
|
 |
XWA_VERSION |
VARCHAR(255) |
 |
|
|
null |
|
 |
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 |
 |
XWA_ID |
BIG_INT(20) |
 |
|
|
0 |
|
 |
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 |
 |
XWA_ID |
BIGINT(20) |
 |
|
|
0 |
|
 |
XWA_CONTENT |
MEDIUMBLOB |
 |
|
|
|
|
^ 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 |
 |
XWO_ID |
INTEGER |
 |
|
|
0 |
Points to xwikidoc table |
 |
XWO_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWO_CUSTOM_MAPPING |
TEXT |
|
|
|
null |
|
 |
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 |
 |
XWP_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWP_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWP_PRETTYNAME |
VARCHAR(255) |
|
|
|
null |
|
 |
XWP_CLASSTYPE |
VARCHAR(255) |
|
|
|
null |
|
 |
XWP_UNMODIFIABLE |
TINYINT(1) |
|
|
|
null |
|
 |
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 |
 |
XWS_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWS_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWS_SIZE |
INTEGER |
|
|
|
null |
|
 |
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 |
 |
XWN_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWN_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWS_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWS_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWS_SIZE |
INTEGER |
|
|
|
null |
|
 |
XWS_EMPTY_IS_TODAY |
INTEGER |
|
|
|
null |
|
 |
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 |
 |
XWN_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWN_NAME |
VARCHAR(255) |
 |
|
|
null |
|
 |
XWN_SIZE |
INTEGER |
 |
|
|
null |
|
 |
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 |
 |
XWL_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWL_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWL_DISPLAYTYPE |
VARCHAR(20) |
|
|
|
null |
|
 |
XWL_MULTISELECT |
TINYINT(1) |
|
|
|
null |
|
 |
XWL_SIZE |
INTEGER |
|
|
|
null |
|
 |
XWL_RELATIONAL |
TINYINT(1) |
|
|
|
null |
|
 |
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 |
 |
XWL_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWL_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWL_DISPLAYTYPE |
VARCHAR(20) |
|
|
|
null |
|
 |
XWL_MULTISELECT |
TINYINT(1) |
|
|
|
null |
|
 |
XWL_SIZE |
INTEGER |
|
|
|
null |
|
 |
XWL_RELATIONAL |
TINYINT(1) |
|
|
|
null |
|
 |
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 |
 |
XWO_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWO_NUMBER |
INTEGER |
|
|
|
null |
|
 |
XWO_NAME |
VARCHAR(255) |
 |
|
|
null |
|
 |
XWO_CLASSNAME |
VARCHAR(255) |
 |
|
|
|
|
^ 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 |
 |
XWP_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWP_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWS_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWS_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWL_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWL_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWS_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWS_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWD_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWD_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWF_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWF_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWI_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWI_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWL_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWL_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
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 |
 |
XWL_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWL_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWL_VALUE |
VARCHAR(255) |
|
|
|
null |
|
 |
XWL_NUMBER |
INTEGER |
 |
|
|
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 |
 |
XWL_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWL_NAME |
VARCHAR(255) |
 |
|
|
|
|
^ 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 |
 |
XWS_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWS_NUMBER |
INTEGER |
|
|
|
null |
|
 |
XWS_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWS_CLASSNAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWS_ACTION |
VARCHAR(255) |
 |
|
|
|
|
 |
XWS_PAGE_VIEWS |
INTEGER |
|
|
|
null |
|
 |
XWS_UNIQUE_VISITORS |
INTEGER |
|
|
|
null |
|
 |
XWS_PERIOD |
INTEGER |
|
|
|
null |
|
 |
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 |
 |
XWR_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWR_NUMBER |
INTEGER |
|
|
|
null |
|
 |
XWR_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWR_CLASSNAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWR_REFERER |
VARCHAR(255) |
 |
|
|
|
|
 |
XWR_PAGE_VIEWS |
INTEGER |
|
|
|
null |
|
 |
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 |
 |
XWV_ID |
INTEGER |
 |
|
|
0 |
|
 |
XWV_NUMBER |
INTEGER |
|
|
|
null |
|
 |
XWV_NAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWV_CLASSNAME |
VARCHAR(255) |
 |
|
|
|
|
 |
XWV_IP |
VARCHAR(32) |
 |
|
|
|
|
 |
XWV_USER_AGENT |
VARCHAR(255) |
 |
|
|
|
|
 |
XWV_COOKIE |
VARCHAR(255) |
 |
|
|
|
|
 |
XWV_UNIQUE_ID |
VARCHAR(255) |
 |
|
|
|
|
 |
XWV_PAGE_VIEWS |
INTEGER |
|
|
|
null |
|
 |
XWV_SAVES |
INTEGER |
|
|
|
null |
|
 |
XWV_DOWNLOADS |
INTEGER |
|
|
|
null |
|
 |
XWV_START_DATE |
DATETIME |
|
|
|
null |
|
 |
XWV_END_DATE |
DATETIME |
|
|
|
null |
|
^ back to top ^
Comments: 0