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

Conversation

@rakeshkky
Copy link
Member

@rakeshkky rakeshkky commented May 22, 2019

TODO:- console should issue combined SQL alter statement on modifying foreign key constraints

Description

Fixes:- server throws dependency error when user trying to alter a foreign key constraint to define cascade attribute when there is relationship defined on the foreign key.

Affected components

  • Server
  • Tests
  • Console

Related Issues

fix #2238, #2060

Solution and Design

"A foreign key is considered to be dropped only if it's constraint oid and custom unique id changes where a custom unique id is a collective reference to column mapping and reference table "

Steps to test and verify

  • Define a Postgres schema with foreign keys
  • Track tables and relationship based on foreign keys
  • Alter a foreign key constraint without changing the reference table and column mapping

@rakeshkky rakeshkky added s/ok-to-merge Status: This pull request can be merged to master c/server Related to server labels May 22, 2019
@rakeshkky rakeshkky requested a review from 0x777 as a code owner May 22, 2019 16:26
@rakeshkky rakeshkky self-assigned this May 22, 2019
@netlify
Copy link

netlify bot commented May 22, 2019

Deploy preview for hasura-docs ready!

Built with commit 60e29f2

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

@rakeshkky rakeshkky changed the title do not consider foreign keys are dropped only if constraint oid changes (fix #2238) do not consider foreign keys are dropped only if constraint oid changes (fix #2238, #2060) May 22, 2019
@rakeshkky rakeshkky added the c/console Related to console label May 22, 2019
@rakeshkky rakeshkky requested a review from rikinsk-zz as a code owner May 22, 2019 17:20
@hasura-bot
Copy link
Contributor

Review app for commit 97e3ed4 deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-97e3ed41

@hasura-bot
Copy link
Contributor

Review app for commit 513e7ee deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-513e7ee4

@hasura-bot
Copy link
Contributor

Review app for commit df47b03 deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-df47b039

@hasura-bot
Copy link
Contributor

Review app for commit 3a64cbb deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-3a64cbb5

rakeshkky and others added 2 commits May 28, 2019 15:41
Resolve Conflicts:
	console/src/components/Services/Data/TableModify/ModifyActions.js
@hasura-bot
Copy link
Contributor

Review app for commit 73508bd deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-73508bd7

@hasura-bot
Copy link
Contributor

Review app for commit bf00aef deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-bf00aefd

0x777
0x777 previously approved these changes May 31, 2019
@hasura-bot
Copy link
Contributor

Review app for commit 60cb6f7 deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-60cb6f72

@hasura-bot
Copy link
Contributor

Review app for commit 3ef9cab deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-3ef9cabf

0x777
0x777 previously approved these changes Jun 3, 2019
@hasura-bot
Copy link
Contributor

Review app for commit 60e29f2 deployed to Heroku: https://hge-ci-pull-2252.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2252-60e29f20

@rikinsk-zz rikinsk-zz added s/do-not-merge Do not merge this pull request to master and removed s/ok-to-merge Status: This pull request can be merged to master labels Jun 3, 2019
@rikinsk-zz
Copy link

rikinsk-zz commented Jun 3, 2019

Need to fix constraint name generated. Currently it adds a suffix even if original is going to be deleted.

Edit: fixed

@0x777 0x777 merged commit 31cf731 into hasura:master Jun 3, 2019
@hasura-bot
Copy link
Contributor

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

@rakeshkky rakeshkky removed the s/do-not-merge Do not merge this pull request to master label Jun 10, 2019
polRk pushed a commit to polRk/graphql-engine that referenced this pull request Feb 12, 2020
…sura#2060) (hasura#2252)

foreign keys are considered to be dropped only if constraint oid changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/console Related to console c/server Related to server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow migrations to be forced, and to sync metadata after applied

5 participants