Whats the tinyint Form for CreateTableSQL in schema function?
Posted: 15 Nov 2018, 12:40
Hello,
currently I'm developing my first plugin and need some MySql Tables.
I've come along with the schema function in my plugin class and have found this way to create a new table, as seen in the code block below.
My question is: What's the short form for tinyint in this CreateTableSQL Syntax?
I've searched in the documentations of mantis, in the code itself, in this forum but couldn't find a hint or answer.
I wanted the enabled field to be a tinyint field like all normal mantis-table-enable-fields are, e.g. in the table mantis_project_table.
C - Char
I - Integer
XL - Longtext
? - Tinyint
Could someone help me please?
Thanks in advance
currently I'm developing my first plugin and need some MySql Tables.
I've come along with the schema function in my plugin class and have found this way to create a new table, as seen in the code block below.
My question is: What's the short form for tinyint in this CreateTableSQL Syntax?
I've searched in the documentations of mantis, in the code itself, in this forum but couldn't find a hint or answer.
I wanted the enabled field to be a tinyint field like all normal mantis-table-enable-fields are, e.g. in the table mantis_project_table.
Code: Select all
function schema()
{
return array(
array( 'CreateTableSQL', array( plugin_table( 'thing' ), "
id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
name C(128) NOTNULL DEFAULT \" '' \",
# Whats the tinyint short form here to use?
enabled tinyint(4) NOT NULL DEFAULT '1',
description XL DEFAULT \" '' \",
", array( 'mysql' => 'DEFAULT CHARSET=utf8' )
)
),
...
I - Integer
XL - Longtext
? - Tinyint
Could someone help me please?
Thanks in advance