{"action":"created","issue":{"url":"https://api.github.com/repos/opengisch/metaproject/issues/2","labels_url":"https://api.github.com/repos/opengisch/metaproject/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/opengisch/metaproject/issues/2/comments","events_url":"https://api.github.com/repos/opengisch/metaproject/issues/2/events","html_url":"https://github.com/opengisch/metaproject/issues/2","id":107333263,"number":2,"title":"Same field name on multiple children tables","user":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"3nids","id":127259,"avatar_url":"https://avatars.githubusercontent.com/u/127259?v=3","gravatar_id":"","url":"https://api.github.com/users/3nids","html_url":"https://github.com/3nids","followers_url":"https://api.github.com/users/3nids/followers","following_url":"https://api.github.com/users/3nids/following{/other_user}","gists_url":"https://api.github.com/users/3nids/gists{/gist_id}","starred_url":"https://api.github.com/users/3nids/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3nids/subscriptions","organizations_url":"https://api.github.com/users/3nids/orgs","repos_url":"https://api.github.com/users/3nids/repos","events_url":"https://api.github.com/users/3nids/events{/privacy}","received_events_url":"https://api.github.com/users/3nids/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-09-19T13:22:30Z","updated_at":"2015-09-19T15:33:47Z","closed_at":null,"body":"Multiple children table with the same field should allow to remap the field name on the generated view.\r\n\r\nExample:\r\n\r\n * od_wastewater_structure\r\n   * od_manhole\r\n   * od_special_structure\r\n\r\nBoth child tables have a field `function`\r\n\r\nEither the field should automatically be renamed on the view to `manhole_function` and `special_structure_function` or it should accept a remap name like\r\n\r\n```\r\n{\r\n  \"od_wastewater_structure\": {\r\n    \"pkey_nextval\": \" qgep.generate_oid(''od_wastewater_structure'')\", \r\n    \"inherited_by\": {\r\n      \"od_special_structure\": {\r\n        \"table_name\": \"qgep.od_special_structure\", \r\n        \"pkey\": \"obj_id\",\r\n        \"fields\": {\r\n           \"function\": {\r\n             \"remap\": \"special_structure_function\"\r\n          }\r\n        }\r\n      }, \r\n      \"od_manhole\": {\r\n        \"table_name\": \"qgep.od_manhole\", \r\n        \"pkey\": \"obj_id\",\r\n        \"fields\": {\r\n           \"function\": {\r\n             \"remap\": \"manhole_function\"\r\n          }\r\n        }\r\n      }\r\n    }, \r\n    \"pkey\": \"obj_id\"\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/opengisch/metaproject/issues/comments/141679817","html_url":"https://github.com/opengisch/metaproject/issues/2#issuecomment-141679817","issue_url":"https://api.github.com/repos/opengisch/metaproject/issues/2","id":141679817,"user":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"created_at":"2015-09-19T15:33:47Z","updated_at":"2015-09-19T15:33:47Z","body":"I am not sure I understand your question.\r\nAn object is always just of one type (one subclass) so there is no conflicting information.\r\n\r\nSo there are two possibilities on the merged view, should there be\r\n\r\n * one merged field for the subclass fields (if they are semantically the same)\r\n * one field for each subclass field (if they are semantically not the same)\r\n\r\nExample 1: Merge\r\n========\r\n\r\n**Depth** is portable between the different subclasses. Hence it shall be treated as one single field on the parent table which is NULL for wastewater structure types which do not support it.\r\n\r\nInput\r\n------\r\n\r\n**Wastewater Structure**\r\n\r\n| obj_id |\r\n|--------|\r\n| MH1    |\r\n| SS1    |\r\n\r\n**Manhole**\r\n\r\n| obj_id | depth |\r\n|--------|-------|\r\n| MH1    | 15    |\r\n\r\n**Special Structure**\r\n\r\n| obj_id | depth |\r\n|--------|-------|\r\n| SS1    | 20    |\r\n\r\nWastewater Structure View (Result)\r\n-------------------\r\n\r\n| obj_id | depth |\r\n|--------|-------|\r\n| MH1    | 15    |\r\n| SS1    | 20    |\r\n\r\nExample 2: Remap\r\n========\r\n\r\n**Function** is different on manhole and special structure. The foreign key defined on the two subtables point to different value lists. Therefore the values are not portable and cannot be mapped to one merged field on the view.\r\n\r\nInput\r\n-----\r\n\r\n**Wastewater Structure**\r\n\r\n| obj_id |\r\n|--------|\r\n| MH1    |\r\n| SS1    |\r\n\r\n**Manhole**\r\n\r\n| obj_id | function |\r\n|--------|-------|\r\n| MH1    | 1004    |\r\n\r\n**Special Structure**\r\n\r\n| obj_id | function |\r\n|--------|-------|\r\n| SS1    | 2008    |\r\n\r\nWastewater Structure View (Result)\r\n-------------------\r\n\r\n\r\n| obj_id | manhole_function | special_structure_function |\r\n|--------|------------------|----------------------------|\r\n| MH1    | 1004             | NULL                       |\r\n| SS1    | NULL             | 2008                       |"}}