[STDM-dev] ON UPDATE ON DELETE Options for Foreign Key Values

Wanjohi Kibui swanjohi9 at gmail.com
Mon Dec 4 18:46:56 PST 2017


Hello,
It's great you've highlighted this. I'm also for the opinion of using
CASCADE!

Kind Regards,

*WANJOHI KIBUI*
*GIS Consultant - Developer and Trainer*

*Mobile: +254 719 696921*
*Website: *



*w <http://www.lifeingis.com/>ww.lifeingis.com <http://www.lifeingis.com/>w
<http://www.lifeingis.com/>ww.geosymp.com <http://www.geosymp.com/>*
*Knowing is not enough, we must apply. **Being willing is not enough, we
must do.*


On Mon, Dec 4, 2017 at 5:23 PM, John Gitau <gkahiu at gmail.com> wrote:

> Dear devs,
>
> I came across an error when trying to delete a parent row whose value is
> referenced (as a foreign key) by one or more rows in a child table. The
> reason is because the default behaviour of the foreign key on delete has
> been set to NO ACTION during the creation of the foreign key.
>
> What I would like to propose is to make the ForeignKeyColumn
> <https://github.com/gltn/stdm/blob/master/data/configuration/columns.py#L693>
> more flexible so that it accepts other options such as SET NULL, CASCADE or
> SET DEFAULT with SET NULL as the default. In addition, I would like to
> explicitly set CASCADE as the default option for foreign keys in the social
> tenure relationship table so that a tenure relation is automatically
> deleted if a party or spatial unit has been removed as it will no longer be
> valid.
>
> Let me know your thoughts on this.
>
> Regards,
>
> John
>
> _______________________________________________
> STDM-dev mailing list
> STDM-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/stdm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/stdm-dev/attachments/20171205/2575a6a1/attachment.html>


More information about the STDM-dev mailing list