[TYPO3-dev] DBAL documentation...

ries van Twisk typo3 at rvt.dds.nl
Sun Sep 9 01:22:41 CEST 2007


Hey Guys,

when I create extensions I often create my tables by hand.

This is how such a table looks like :

CREATE TABLE tbl_press_releases (
        uid integer NOT NULL AUTO_INCREMENT,
      pid integer NOT NULL,
      cruser_id integer NOT NULL,
      deleted integer NOT NULL,
      hidden integer NOT NULL,
      tstamp integer NOT NULL,
      crdate integer NOT NULL,
      release_type integer NOT NULL,
      release_date integer
      fe_user_uid INTEGER NOT NULL,
      be_user_uid INTEGER NOT NULL,
      organisation TEXT NOT NULL,
      name TEXT NOT NULL,
      contact_mail TEXT NOT NULL,
      contact_phone TEXT NOT NULL,
      title TEXT NOT NULL,
      description_short TEXT NOT NULL,
      description_long TEXT NOT NULL,
      city TEXT NOT NULL,
      country TEXT NOT NULL,
      approved integer NOT NULL,
      approved_by TEXT NOT NULL,
      link TEXT NOT NULL,
      image TEXT NOT NULL,
      PRIMARY KEY (uid)
);



Now in the BE when I want to install my extension and the table does  
exists I get loads of changes,
here are a couple of examples:

ALTER TABLE tbl_press_releases CHANGE pid pid integer NOT NULL  
default 0;
  	Current value: int(11) default '0'


Why does TYPO3 create int(11) in the databases while I specify integer.
I found using int(11) highly confusing since it does suggest an  
integer with length 11 character
while in fact it's not and only does something with space padding.


One other problem I noticed is that when I define a compound key then  
TYPO3
keeps on wanting to add that key to the database, while in fact it  
was already been added.


Now I want to change my SQL to the correct TYPO3 format, but
I have a hard time understanding what is standard. I know
once it has been said 'TYPO3 follows a subset of mysql' but that  
doesn't tell
me much how I nee to define my SQL's. Normally I don't care much  
because 95%
of teh extension I create a private and are for no use of teh community.
But in this case I might want to publish the extension to TER. And  
want to conform to something.

Any pointer to DBAL docs?

Ries








--
Ries van Twisk
Freelance TYPO3 Developer
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/
skype: callto://r.vantwisk
Phone: + 1 810-476-4193










More information about the TYPO3-dev mailing list