{"action":"opened","issue":{"url":"https://api.github.com/repos/QGEP/QGEP/issues/155","labels_url":"https://api.github.com/repos/QGEP/QGEP/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/QGEP/QGEP/issues/155/comments","events_url":"https://api.github.com/repos/QGEP/QGEP/issues/155/events","html_url":"https://github.com/QGEP/QGEP/issues/155","id":112096117,"number":155,"title":"Definition of ON DELETE actions","user":{"login":"sjib","id":1265865,"avatar_url":"https://avatars.githubusercontent.com/u/1265865?v=3","gravatar_id":"","url":"https://api.github.com/users/sjib","html_url":"https://github.com/sjib","followers_url":"https://api.github.com/users/sjib/followers","following_url":"https://api.github.com/users/sjib/following{/other_user}","gists_url":"https://api.github.com/users/sjib/gists{/gist_id}","starred_url":"https://api.github.com/users/sjib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjib/subscriptions","organizations_url":"https://api.github.com/users/sjib/orgs","repos_url":"https://api.github.com/users/sjib/repos","events_url":"https://api.github.com/users/sjib/events{/privacy}","received_events_url":"https://api.github.com/users/sjib/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/QGEP/QGEP/labels/Datamodel","name":"Datamodel","color":"fad8c7"},{"url":"https://api.github.com/repos/QGEP/QGEP/labels/P1","name":"P1","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"sjib","id":1265865,"avatar_url":"https://avatars.githubusercontent.com/u/1265865?v=3","gravatar_id":"","url":"https://api.github.com/users/sjib","html_url":"https://github.com/sjib","followers_url":"https://api.github.com/users/sjib/followers","following_url":"https://api.github.com/users/sjib/following{/other_user}","gists_url":"https://api.github.com/users/sjib/gists{/gist_id}","starred_url":"https://api.github.com/users/sjib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjib/subscriptions","organizations_url":"https://api.github.com/users/sjib/orgs","repos_url":"https://api.github.com/users/sjib/repos","events_url":"https://api.github.com/users/sjib/events{/privacy}","received_events_url":"https://api.github.com/users/sjib/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-10-19T08:22:31Z","updated_at":"2015-10-19T08:22:31Z","closed_at":null,"body":"Single object delete (e.g. only cover) and cascades object delete (e,g, full wastewater_structure element with all connected structure_parts). \r\nDefinitions for each foreign key on delete constraints: e.g. \r\nstructure_part.fk_wastewater_structure on delete set null / cascade / restrict (delete is forbidden) / set default (we cannot us this)\r\nSB send UK list of foreignkeys - adding colum with 3 on delete options\r\n\r\nin model: extend create foreignkey with ON DELETE actions\r\n\r\nALTER TABLE qgep.od_structure_part ADD CONSTRAINT rel_structure_part_wastewater_structure FOREIGN KEY (fk_wastewater_structure) REFERENCES qgep.od_wastewater_structure(obj_id);\r\nnew:\r\nALTER TABLE qgep.od_structure_part ADD CONSTRAINT rel_structure_part_wastewater_structure FOREIGN KEY (fk_wastewater_structure) REFERENCES qgep.od_wastewater_structure(obj_id) ON DELETE cascade;\r\n"}}