0 votes

Doctrine2 cascade option SET_NULL is incorrect.

It will result in an Invalid foreign key action: SET_NULL error. I'm using version

Updating the Doctrine2.skipper.cfg.xml solves it!

<!-- http://www.doctrine-project.org/projects/orm/2.0/docs/reference/basic-mapping/en#doctrine-mapping-types -->

    <!-- SET_NULL is Invalid foreign key action, so we override it -->
        <struct name="ManyToManyEntity" section="orm"
            <attribute name="on-delete" type="enum" enum-values="CASCADE|RESTRICT|SET NULL"
                       help-text="Cascade Action (Database-level)"
            <attribute name="on-update" type="enum" enum-values="CASCADE|RESTRICT|SET NULL"
                       help-text="Cascade Action (Database-level). Warning: Removed from version 2.2 (DDC-1628)."

asked in Solved by (220 points)
recategorized by

Thanks for info. We will update it for next release.

This issue is fixed in latest beta (including migration script to update existing SET_NULL values to correct SET NUL).


Please test it and let me know if everything now works as expected. Thanks

Please log in or register to answer this question.