Whats the tinyint Form for CreateTableSQL in schema function?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Onetaluko
Posts: 7
Joined: 15 Nov 2018, 12:08

Whats the tinyint Form for CreateTableSQL in schema function?

Post by Onetaluko »

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.

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' )
                )
            ),
...
C - Char
I - Integer
XL - Longtext
? - Tinyint

Could someone help me please?

Thanks in advance
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Whats the tinyint Form for CreateTableSQL in schema function?

Post by atrol »

We use ADOdb as our database abstraction layer.
http://adodb.org/dokuwiki/doku.php?id=v ... nary_index
From what I see, I2 is what you are looking for.
Please use Search before posting and read the Manual
Onetaluko
Posts: 7
Joined: 15 Nov 2018, 12:08

Re: Whats the tinyint Form for CreateTableSQL in schema function?

Post by Onetaluko »

Thank you for the ADOdb information.

Unfortunately the schema function won't work in my beginnings and I created the tables by hand.

But it is a good link to see the summary of types.
Post Reply