[TYPO3-dev] Default definitions of database fields
Jochen Rau
jochen.rau at typoplanet.de
Sat Feb 13 17:20:28 CET 2010
Hi.
An additional note.
> 4. Add a DEFAULT only if it is necessary. Most DEFAULTS I have found in
> a standard TYPO3 database definition are - ehrm - the defaults of MySQL.
>
> Instead of
>
> sorting int(10) DEFAULT '0' NOT NULL,
>
> you can simply write (and better read)
>
> sorting int(10) NOT NULL,
There seems to be a bug in MySQL as
sorting int(10) NOT NULL,
works as expected, but
deleted tinyint(1) unsigned NOT NULL,
does not insert a 0 (zero) as default. Instead I get a NULL. Confusing.
So, I decided for me to set the DEFAULT explicitly.
Jochen
More information about the TYPO3-dev
mailing list