[TYPO3-dev] ext_tables.sql - signed integer field syntax

Fabien Udriot fudriot at omic.ch
Thu Jun 23 14:41:42 CEST 2011


Thansk Jigal for your reply, it has helped! :)

 > 'signed' is not a keyword which can be used in that location (it is not a reserved word at all
 > for MySQL).

solution: number int(11) DEFAULT '0' NOT NULL,

As simple as that... Why haven't I thought? ;)


> 'signed' is not a keyword which can be used in that location (it is not a reserved word at all for
> MySQL).
> You can use:
> INT[(length)] [UNSIGNED] [ZEROFILL]
> for the data type part and
> [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] .....
> (see [1]) after that as a column definition.
>
> Integer fields are signed by default in MySQL.
>
>> BTW, is this "syntax" documented somewhere? I didn't find much in the
>> doc_core_*. The best I could spot is some example in "doc_core_inside"
>
> It's in t3lib_install::getFieldDefinitions_database(). It basically performs a
> SHOW COLUMNS FROM table_name
> query. From the result the 'Type' field is used.
> If the 'Null' field equals 'NO' "NOT NULL" is added.
> If the type is not a 'blob' or 'text' and no 'auto_increment' is set, "default 'default_value'" is
> added
> If the 'Extra' field is filled that is added to.
>
> After that the keys (indexes) are added followd by the engine and collation.
>
> This is compared with the definition in the extensions ext_tables.sql file by
> t3lib_install::getDatabaseExtra()

Good to have this method pointed out as well!




More information about the TYPO3-dev mailing list