{"action":"created","issue":{"url":"https://api.github.com/repos/qwat/qwat-data-model/issues/62","labels_url":"https://api.github.com/repos/qwat/qwat-data-model/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/qwat/qwat-data-model/issues/62/comments","events_url":"https://api.github.com/repos/qwat/qwat-data-model/issues/62/events","html_url":"https://github.com/qwat/qwat-data-model/issues/62","id":109235911,"number":62,"title":"qwat_od.ft_leak_geom() improvement","user":{"login":"bogdanvaduva","id":11473648,"avatar_url":"https://avatars.githubusercontent.com/u/11473648?v=3","gravatar_id":"","url":"https://api.github.com/users/bogdanvaduva","html_url":"https://github.com/bogdanvaduva","followers_url":"https://api.github.com/users/bogdanvaduva/followers","following_url":"https://api.github.com/users/bogdanvaduva/following{/other_user}","gists_url":"https://api.github.com/users/bogdanvaduva/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdanvaduva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdanvaduva/subscriptions","organizations_url":"https://api.github.com/users/bogdanvaduva/orgs","repos_url":"https://api.github.com/users/bogdanvaduva/repos","events_url":"https://api.github.com/users/bogdanvaduva/events{/privacy}","received_events_url":"https://api.github.com/users/bogdanvaduva/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-01T06:09:07Z","updated_at":"2015-10-01T06:17:42Z","closed_at":"2015-10-01T06:15:53Z","body":"Hi everybody,\r\n\r\nHere is the problem that I had.\r\nI have a leak which is reported to be on street A where I have a pipe A. The leak is near an intersection with another street (street B where I have a pipe B). The repair crew will dig on street A but will find out that the leak comes from pipe B. \r\nWhen I try to insert the leak on street A and select pipe B I found out that pipe B is deleted because of\r\nthe code:\r\n\r\nNEW.fk_pipe            := qwat_od.fn_pipe_get_id(NEW.geometry);\r\n\r\nI modified the trigger like this:\r\n\r\nNEW.fk_pipe            := CASE WHEN qwat_od.fn_pipe_get_id(NEW.geometry) IS NULL THEN NEW.fk_pipe ELSE qwat_od.fn_pipe_get_id(NEW.geometry) END;\r\n\r\nAfter that it worked fine.\r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/qwat/qwat-data-model/issues/comments/144631818","html_url":"https://github.com/qwat/qwat-data-model/issues/62#issuecomment-144631818","issue_url":"https://api.github.com/repos/qwat/qwat-data-model/issues/62","id":144631818,"user":{"login":"bogdanvaduva","id":11473648,"avatar_url":"https://avatars.githubusercontent.com/u/11473648?v=3","gravatar_id":"","url":"https://api.github.com/users/bogdanvaduva","html_url":"https://github.com/bogdanvaduva","followers_url":"https://api.github.com/users/bogdanvaduva/followers","following_url":"https://api.github.com/users/bogdanvaduva/following{/other_user}","gists_url":"https://api.github.com/users/bogdanvaduva/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdanvaduva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdanvaduva/subscriptions","organizations_url":"https://api.github.com/users/bogdanvaduva/orgs","repos_url":"https://api.github.com/users/bogdanvaduva/repos","events_url":"https://api.github.com/users/bogdanvaduva/events{/privacy}","received_events_url":"https://api.github.com/users/bogdanvaduva/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T06:17:42Z","updated_at":"2015-10-01T06:17:42Z","body":"But I need the pipe id even if it's not found by qwat_od.fn_pipe_get_id(NEW.geometry). "}}