[TYPO3-dev] where is exec_alter_table or similar?

Ernesto Baschny [cron IT] ernst at cron-it.de
Sat Jul 26 15:34:42 CEST 2008


Franz Holzinger wrote: on 23.07.2008 17:16:
> Hello
> 
> Dmitry Dulepov [typo3] a écrit :
>> Franz Holzinger wrote:
>>> where can I find a function to alter the keys for a table in t3lib_DB ?
>>>
>>> I want to execute a SQL 'ALTER TABLE ...' command.
>>> But the function $TYPO3_DB->sql is marked as deprecated.
>> $GLOBALS['TYPO3_DB']->sql_query. But if you alter TYPO3 table, EM will
>> prompt you to restore it when you update extension. Altering tables is a
>> task reserved to TYPO3 core by default.
> 
> But I should drop the keys before starting a long import script. And
> after this has finished, the keys must be created again.


You don't need to drop the keys, just use:

   ALTER TABLE table DISABLE KEYS;

and after finishing the import

   ALTER TABLE table ENABLE KEYS;

This is of course MySQL specific.

Cheers,
Ernesto




More information about the TYPO3-dev mailing list