I revived an important page for developers, which phpBB mistakenly deleted from the Wiki with it. Using ‘MD pipe tables’ with some CSS.
Introduction
The Database Type Map was designed to make creating installations for multiple database systems a simple task. Instead of having to write specific install instructions for each separate database system you can write one set of instructions and, using the Database Type Map and db_tools, alter any supported database system with a single command.
Type Map
Note that with some commands you may enter the Zerofill, example ‘INT:11’, if the field is a numeric one. With some you may enter the length of the field, example ‘VARCHAR:255’. This will make a varchar(255) column in MySQL. In all of the fields supporting this, they will have a colon followed by %d meaning any number may fill the space of the %d.
Numeric
Command | MySQL eq | Storage Range (on MySQL) | Range |
---|---|---|---|
TINT:%d | tinyint(%d) | from -128 to 127 | Signed |
INT:%d | int(%d) | from -2,147,483,648 to 2,147,483,647 | Signed |
BINT | bigint(20) | from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | Signed |
USINT | smallint(4) | from 0 to 65,535 | Unsigned |
UINT | mediumint(8) | from 0 to 16,777,215 | Unsigned |
UINT:%d | int(%d) | from 0 to 4,294,967,295 | Unsigned |
ULINT | int(10) | from 0 to 4,294,967,295 | Unsigned |
Decimal
Command | MySQL eq | Storage Range (on MySQL) | Range |
---|---|---|---|
DECIMAL | decimal(5,2) | from -999.99 to 999.99 | Signed |
DECIMAL:%d | decimal(%d, 2) | -(%d - 2 digits to the left of the decimal).99 to (%d - 2 digits to the left of the decimal).99 | Signed |
PDECIMAL | decimal(6,3) | from -999.999 to 999.999 | Signed |
PDECIMAL:%d | decimal(%d,3) | -(%d - 3 digits to the left of the decimal).999 to (%d - 3 digits to the left of the decimal)9.99 | Signed |
Text
These should only be used for ASCII characters.
If you plan to use it for something like message text read the Unicode Text section
Command | MySQL eq | Explain |
---|---|---|
VCHAR | varchar(255) | |
VCHAR:%d | varchar(%d) | |
CHAR:%d | char(%d) | |
XSTEXT | text | text for storing 100 characters |
STEXT | text | text for storing 255 characters |
TEXT | text | text for storing 3000 characters |
MTEXT | mediumtext |
Unicode Text
Command | MySQL eq | Explain |
---|---|---|
VCHAR_UNI | varchar(255) | text for storing 255 characters (normal input field with a max of 255 single-byte chars) |
VCHAR_UNI:%d | varchar(%d) | text for storing %d characters (normal input field with a max of %d single-byte chars) |
XSTEXT_UNI | varchar(100) | text for storing 100 characters (topic_title for example) |
STEXT_UNI | varchar(255) | text for storing 255 characters (normal input field with a max of 255 single-byte chars) |
TEXT_UNI | text | text for storing 3000 characters (short text, descriptions, comments, etc.) |
MTEXT_UNI | mediumtext | (post text, large text) |
Miscellaneous
Command | MySQL eq | Explain |
---|---|---|
BOOL | tinyint(1) UNSIGNED | Storing boolean values (true/false) |
TIMESTAMP | int(11) UNSIGNED | For storing UNIX timestamps |
VCHAR_CI | varchar(255) | varchar_ci for postgresql, others VCHAR |
VARBINARY | varbinary(255) | Binary storage |