[FLOW3-general] doctrine:update error

Karsten Dambekalns karsten at typo3.org
Wed Aug 29 10:10:35 CEST 2012


Hi.

On 10.08.12 10:57, Wasko Jugovic wrote:
> I need a table with an auto-incrementing column "idnr".
> When I do doctrine:update for the very first time this table is created:
…
> But if I do now  doctrine:update and the table already exists in database,
> I get this error:
…

I reproduced this, and the first update is correct:

ALTER TABLE … ADD idnr INT(11) NOT NULL AUTO_INCREMENT UNIQUE;

On the second run, Doctrine still thinks it needs to update the column,
and is "smart" enough to try and drop the index on idnr first - but this
leads to the error:

DROP INDEX idnr ON …;
ALTER TABLE … CHANGE idnr idnr INT(11) NOT NULL AUTO_INCREMENT UNIQUE;

The fact that the change, although no longer needed, is still applied,
is a Doctrine bug, we'll have to hope for a fix.

That being said, you should be using migrations - then a problem like
that will not happen, because every migration is run only once.

Regards,
Karsten
-- 
Karsten Dambekalns
TYPO3 Core Developer, FLOW3 / Phoenix Team

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the FLOW3-general mailing list