{"action":"created","comment":{"url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/comments/114060920","pull_request_review_id":35503678,"id":114060920,"diff_hunk":"@@ -685,3 +685,43 @@ to assign the current airport to another region.\n    :align: center\n \n    Identification dialog airport with relation to regions\n+\n+.. index:: Many-to-many relation; Relation\n+\n+N-M relation\n+-------------\n+\n+N-M relation are many-to-many relation between two tables. For instance a layer\n+of *Shop* and *Product* layer. A product is sold in several shop and a shop\n+sell several product.\n+\n+In such case we have a pivot table to list all product for all shop. In QGIS,\n+you should setup two relation one-to-many as explain above. One for the\n+relation between *Product* table and the pivot table and the second one between\n+*Shop* and the pivote table.\n+\n+When we add a new children (i.e. a product in a shop), QGIS will add a new row in\n+the pivot table and in the *Product* table. If we link a product into a shop,\n+QGIS will add only a row in the pivot table.\n+\n+In case you want to remove a link, a product or a shop, QGIS won't remove the\n+row in the pivot table. The database administrator should add a *ON DELETE\n+CASCADE* in the foreign key constraint:\n+\n+.. code-block:: sql\n+\n+   ALTER TABLE location.product\n+   ADD CONSTRAINT location_product_shop_id_fkey\n+      FOREIGN KEY (id)\n+         REFERENCES location.shop(id)\n+            ON DELETE CASCADE;\n+\n+Note that you should be in transaction mode when working on such context. QGIS\n+should be able to add or update row(s) in all table (product, shop and the","path":"source/docs/user_manual/working_with_vector/attribute_table.rst","position":45,"original_position":45,"commit_id":"7fa55987508a28f22a3bcd8500d8da44a75d72d4","original_commit_id":"7fa55987508a28f22a3bcd8500d8da44a75d72d4","user":{"login":"tudorbarascu","id":3179646,"avatar_url":"https://avatars1.githubusercontent.com/u/3179646?v=3","gravatar_id":"","url":"https://api.github.com/users/tudorbarascu","html_url":"https://github.com/tudorbarascu","followers_url":"https://api.github.com/users/tudorbarascu/followers","following_url":"https://api.github.com/users/tudorbarascu/following{/other_user}","gists_url":"https://api.github.com/users/tudorbarascu/gists{/gist_id}","starred_url":"https://api.github.com/users/tudorbarascu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tudorbarascu/subscriptions","organizations_url":"https://api.github.com/users/tudorbarascu/orgs","repos_url":"https://api.github.com/users/tudorbarascu/repos","events_url":"https://api.github.com/users/tudorbarascu/events{/privacy}","received_events_url":"https://api.github.com/users/tudorbarascu/received_events","type":"User","site_admin":false},"body":"table -> tables","created_at":"2017-04-29T20:09:39Z","updated_at":"2017-04-29T20:12:56Z","html_url":"https://github.com/qgis/QGIS-Documentation/pull/1847#discussion_r114060920","pull_request_url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847","_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/comments/114060920"},"html":{"href":"https://github.com/qgis/QGIS-Documentation/pull/1847#discussion_r114060920"},"pull_request":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847"}}},"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847","id":118287650,"html_url":"https://github.com/qgis/QGIS-Documentation/pull/1847","diff_url":"https://github.com/qgis/QGIS-Documentation/pull/1847.diff","patch_url":"https://github.com/qgis/QGIS-Documentation/pull/1847.patch","issue_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/1847","number":1847,"state":"open","locked":false,"title":"Add N:M relation editing possibilities","user":{"login":"yjacolin","id":660191,"avatar_url":"https://avatars1.githubusercontent.com/u/660191?v=3","gravatar_id":"","url":"https://api.github.com/users/yjacolin","html_url":"https://github.com/yjacolin","followers_url":"https://api.github.com/users/yjacolin/followers","following_url":"https://api.github.com/users/yjacolin/following{/other_user}","gists_url":"https://api.github.com/users/yjacolin/gists{/gist_id}","starred_url":"https://api.github.com/users/yjacolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjacolin/subscriptions","organizations_url":"https://api.github.com/users/yjacolin/orgs","repos_url":"https://api.github.com/users/yjacolin/repos","events_url":"https://api.github.com/users/yjacolin/events{/privacy}","received_events_url":"https://api.github.com/users/yjacolin/received_events","type":"User","site_admin":false},"body":"Fix #705 \r\n\r\nThanks @m-kuhn :)","created_at":"2017-04-29T19:45:34Z","updated_at":"2017-04-29T20:12:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09a6c4f2c626cfff7cbd1e9be62f540802964e70","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/1847/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS-Documentation/statuses/7fa55987508a28f22a3bcd8500d8da44a75d72d4","head":{"label":"qgis:705_n-mRelationEdition","ref":"705_n-mRelationEdition","sha":"7fa55987508a28f22a3bcd8500d8da44a75d72d4","user":{"login":"qgis","id":483444,"avatar_url":"https://avatars0.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":8466379,"name":"QGIS-Documentation","full_name":"qgis/QGIS-Documentation","owner":{"login":"qgis","id":483444,"avatar_url":"https://avatars0.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qgis/QGIS-Documentation","description":null,"fork":false,"url":"https://api.github.com/repos/qgis/QGIS-Documentation","forks_url":"https://api.github.com/repos/qgis/QGIS-Documentation/forks","keys_url":"https://api.github.com/repos/qgis/QGIS-Documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS-Documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS-Documentation/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS-Documentation/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS-Documentation/events","assignees_url":"https://api.github.com/repos/qgis/QGIS-Documentation/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS-Documentation/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS-Documentation/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS-Documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS-Documentation/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS-Documentation/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS-Documentation/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS-Documentation/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS-Documentation/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS-Documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS-Documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS-Documentation/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS-Documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS-Documentation/merges","archive_url":"https://api.github.com/repos/qgis/QGIS-Documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS-Documentation/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS-Documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS-Documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS-Documentation/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS-Documentation/releases{/id}","deployments_url":"https://api.github.com/repos/qgis/QGIS-Documentation/deployments","created_at":"2013-02-27T21:54:56Z","updated_at":"2017-04-29T15:33:10Z","pushed_at":"2017-04-29T20:01:51Z","git_url":"git://github.com/qgis/QGIS-Documentation.git","ssh_url":"git@github.com:qgis/QGIS-Documentation.git","clone_url":"https://github.com/qgis/QGIS-Documentation.git","svn_url":"https://github.com/qgis/QGIS-Documentation","homepage":null,"size":625677,"stargazers_count":61,"watchers_count":61,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"open_issues_count":279,"forks":198,"open_issues":279,"watchers":61,"default_branch":"release_2.18"}},"base":{"label":"qgis:master","ref":"master","sha":"6b2ae0ed01660ff5223a8072b84f3cf1b4ba88ae","user":{"login":"qgis","id":483444,"avatar_url":"https://avatars0.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":8466379,"name":"QGIS-Documentation","full_name":"qgis/QGIS-Documentation","owner":{"login":"qgis","id":483444,"avatar_url":"https://avatars0.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qgis/QGIS-Documentation","description":null,"fork":false,"url":"https://api.github.com/repos/qgis/QGIS-Documentation","forks_url":"https://api.github.com/repos/qgis/QGIS-Documentation/forks","keys_url":"https://api.github.com/repos/qgis/QGIS-Documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS-Documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS-Documentation/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS-Documentation/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS-Documentation/events","assignees_url":"https://api.github.com/repos/qgis/QGIS-Documentation/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS-Documentation/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS-Documentation/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS-Documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS-Documentation/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS-Documentation/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS-Documentation/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS-Documentation/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS-Documentation/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS-Documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS-Documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS-Documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS-Documentation/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS-Documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS-Documentation/merges","archive_url":"https://api.github.com/repos/qgis/QGIS-Documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS-Documentation/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS-Documentation/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS-Documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS-Documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS-Documentation/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS-Documentation/releases{/id}","deployments_url":"https://api.github.com/repos/qgis/QGIS-Documentation/deployments","created_at":"2013-02-27T21:54:56Z","updated_at":"2017-04-29T15:33:10Z","pushed_at":"2017-04-29T20:01:51Z","git_url":"git://github.com/qgis/QGIS-Documentation.git","ssh_url":"git@github.com:qgis/QGIS-Documentation.git","clone_url":"https://github.com/qgis/QGIS-Documentation.git","svn_url":"https://github.com/qgis/QGIS-Documentation","homepage":null,"size":625677,"stargazers_count":61,"watchers_count":61,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"open_issues_count":279,"forks":198,"open_issues":279,"watchers":61,"default_branch":"release_2.18"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847"},"html":{"href":"https://github.com/qgis/QGIS-Documentation/pull/1847"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/1847"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/issues/1847/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/pulls/1847/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS-Documentation/statuses/7fa55987508a28f22a3bcd8500d8da44a75d72d4"}}}}
{"actor":{"display_login":"tudorbarascu"}}