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 3.2.6.1309.

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 -->
    <attribute-types>
        <struct name="ManyToManyEntity" section="orm"
                help-url="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/xml-mapping.html#defining-many-to-many-associations">
            <attribute name="on-delete" type="enum" enum-values="CASCADE|RESTRICT|SET NULL"
                       help-text="Cascade Action (Database-level)"
                       help-url="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/xml-mapping.html#join-column-element"/>
            <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)."
                       help-url=""/>
        </struct>
    </attribute-types>
</orm-configuration>

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).

https://support.skipper18.com/402/downloads-skipper-beta

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

Please log in or register to answer this question.