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

John Gitau gkahiu at gmail.com
Mon Dec 4 06:23:04 PST 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/stdm-dev/attachments/20171204/add44d4f/attachment.html>


More information about the STDM-dev mailing list