TYPO3 extension sql difference annoyance when updating
Thursday, March 27th, 2008When developing extensions for TYPO3 you often create one or more new tables and/or fields. Quite often you get an annoying report when updating or installing your extension in the EM that says something like:
- ALTER TABLE tx_tentipifr_fieldText CHANGE field_uid field_uid int(11) NOT NULL;
or - ALTER TABLE tx_tentipifr_fieldText DROP KEY parent;
- ALTER TABLE tx_tentipifr_fieldText ADD KEY parent (pid);
while the fields are actually just fine and untouched in your db since last update.
This is because the EM is quite strict to how your ext_tables.sql is formatted. Here is a solution to get rid of the two cases above (example from my ext_tables.sql file):
change
-
..
-
field_uid int(11) NOT NULL,
-
linksource blob NOT NULLPRIMARY KEY (uid),
-
KEY parent (pid),
-
KEY t3ver_oid (t3ver_oid,t3ver_wsid)
-
);
to
-
…
-
field_uid int(11) DEFAULT ’0′ NOT NULL,
-
linksource blob NOT NULLPRIMARY KEY (uid),
-
KEY parent (pid),
-
KEY t3ver_oid (t3ver_oid,t3ver_wsid)
-
);
The integer field notice is fixed by adding DEFAULT ’0′ to the statement and the primary key drop ‘n add thing is fixed solely by removing an extra space right after the field name.
I think these or similar things are fixed or to-be-fixed, but I’m not sure. Just didn’t care to google it. Please let me know if it is so.
