这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@rakeshkky
Copy link
Member

Description

Affected components

  • Server

Related Issues

fix #2228

Solution and Design

Filter foreign keys by having only one column mapping.

Steps to test and verify

DROP TABLE IF EXISTS "public"."account_practitioner_info";
CREATE TABLE "public"."account_practitioner_info" (
  "account_id" int8 NOT NULL,
  "practitioner_id" int8 NOT NULL
)
;

DROP TABLE IF EXISTS "public"."account_practitioners";
CREATE TABLE "public"."account_practitioners" (
  "account_id" int8 NOT NULL,
  "practitioner_id" int8 NOT NULL
)
;

ALTER TABLE "public"."account_practitioner_info" ADD CONSTRAINT "account_practitioner_info_pkey" PRIMARY KEY ("account_id");

ALTER TABLE "public"."account_practitioners" ADD CONSTRAINT "account_id_uniq" UNIQUE ("account_id");

ALTER TABLE "public"."account_practitioners" ADD CONSTRAINT "account_practitioners_pkey" PRIMARY KEY ("account_id", "practitioner_id");

ALTER TABLE "public"."account_practitioner_info" ADD CONSTRAINT "link" FOREIGN KEY ("account_id", "practitioner_id") REFERENCES "public"."account_practitioners" ("account_id", "practitioner_id") ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE "public"."account_practitioner_info" ADD CONSTRAINT "link1" FOREIGN KEY ("account_id") REFERENCES "public"."account_practitioners" ("account_id") ON DELETE NO ACTION ON UPDATE NO ACTION;

Track all tables and relationships

@rakeshkky rakeshkky added s/ok-to-merge Status: This pull request can be merged to master c/server Related to server e/quickfix can be wrapped up in few hours p/urgent Immediate action required labels May 20, 2019
@rakeshkky rakeshkky requested a review from 0x777 as a code owner May 20, 2019 10:35
@rakeshkky rakeshkky self-assigned this May 20, 2019
@netlify
Copy link

netlify bot commented May 20, 2019

Deploy preview for hasura-docs ready!

Built with commit 0e84276

https://deploy-preview-2232--hasura-docs.netlify.com

@hasura-bot
Copy link
Contributor

Review app for commit 8cab631 deployed to Heroku: https://hge-ci-pull-2232.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2232-8cab6315

@hasura-bot
Copy link
Contributor

Review app for commit 0e84276 deployed to Heroku: https://hge-ci-pull-2232.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2232-0e84276a

@shahidhk shahidhk changed the title fix defining relationship on column having multiple foreign keys (fix #2228) allow creating multiple relationships which includes the same column (fix #2228) May 21, 2019
@shahidhk shahidhk merged commit 70f4db1 into hasura:master May 21, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-2232.herokuapp.com is deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/server Related to server e/quickfix can be wrapped up in few hours p/urgent Immediate action required s/ok-to-merge Status: This pull request can be merged to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1 beta1 doesn't allow multiple relationships including same field

4 participants