Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console: allow user to cascade Postgres dependencies when dropping Postgres objects (close #5109) #5248

Merged
merged 20 commits into from
Aug 22, 2020

Conversation

soorajshankar
Copy link
Member

Description

This PR adds a user prompt when the user gets postgress error dependent_objects_still_exist-2BP01

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR. If no changelog is required, then add the no-changelog-required label.

Affected components

  • Console

Related Issues

closes #5109

Solution and Design

This PR will add an on error listener at makeMigrationCall which makes sure that

if there is a Postgres dependency error, the user will get a prompt that allows the user to make a decision whether to continue the operation with cascading dependent modules or to cancel the operation.

Steps to test and verify

  • create a 2 tables which have foreign key relationships.
  • Try deleting the table where the foreign key relationship.
  • check the network response, if this contains postgress error '2BP01' now the user will see an error prompt.
  • click on continue, now check the network query.
  • compare with the previous query, this should contain the cascade in the up query.

Limitations, known bugs & workarounds

  • possibility of inconsistent down migration after the cascade operations.

Does this PR add a new Metadata feature?

  • No

GraphQL

  • No new GraphQL schema is generated

Breaking changes

  • No Breaking changes

@soorajshankar soorajshankar requested a review from a team as a code owner July 1, 2020 08:36
@netlify
Copy link

netlify bot commented Jul 1, 2020

Deploy preview for hasura-docs ready!

Built with commit 3ed8d1e

https://deploy-preview-5248--hasura-docs.netlify.app

@soorajshankar soorajshankar requested a review from a team as a code owner July 1, 2020 08:38
@soorajshankar soorajshankar added the c/console Related to console label Jul 1, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 2827931 deployed to Heroku: https://hge-ci-pull-5248.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5248-28279312

console/src/components/Services/Data/utils.js Outdated Show resolved Hide resolved
console/src/components/Services/Data/utils.js Outdated Show resolved Hide resolved
console/src/components/Services/Data/utils.js Show resolved Hide resolved
@beerose beerose removed their assignment Jul 12, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 30ded79 deployed to Heroku: https://hge-ci-pull-5248.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5248-30ded797

@beerose beerose changed the title Cascade delete on Postgres dependency errors #5109 console: cascade delete on Postgres dependency errors (close #5109) Jul 20, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 67bd1c1 deployed to Heroku: https://hge-ci-pull-5248.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5248-67bd1c1d

@beerose beerose requested a review from rikinsk July 20, 2020 08:35
@beerose beerose assigned rikinsk and unassigned beerose Jul 20, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 6dc6490 deployed to Heroku: https://hge-ci-pull-5248.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5248-6dc64900

Copy link
Member

@rikinsk rikinsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX approved

@rikinsk rikinsk assigned beerose and unassigned rikinsk Aug 21, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 6ec474f deployed to Heroku: https://hge-ci-pull-5248.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5248-6ec474fd

@beerose beerose removed the request for review from tirumaraiselvan August 22, 2020 10:45
@hasura-bot
Copy link
Contributor

Review app for commit 7ff057e deployed to Heroku: https://hge-ci-pull-5248.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5248-7ff057ef

CHANGELOG.md Outdated
@@ -19,6 +19,7 @@ This release contains the [PDV refactor (#4111)](https://github.com/hasura/graph
- server: some mutations that cannot be performed will no longer be in the schema (for instance, `delete_by_pk` mutations won't be shown to users that do not have select permissions on all primary keys) (#4111)
- server: miscellaneous description changes (#4111)
- server: treat the absence of `backend_only` configuration and `backend_only: false` equally (closing #5059) (#4111)
- console: add user prompt to cascade delete on Postgres dependency errors (close #5109) (#5248)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow user to cascade Postgres dependencies when dropping Postgres objects

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@tirumaraiselvan tirumaraiselvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog

@hasura-bot
Copy link
Contributor

Review app for commit d8f5ad8 deployed to Heroku: https://hge-ci-pull-5248.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5248-d8f5ad88

@beerose beerose changed the title console: cascade delete on Postgres dependency errors (close #5109) console: allow user to cascade Postgres dependencies when dropping Postgres objects (close #5109) Aug 22, 2020
@beerose beerose merged commit 41f35c6 into hasura:master Aug 22, 2020
@hasura-bot
Copy link
Contributor

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

stevefan1999-personal pushed a commit to stevefan1999-personal/graphql-engine that referenced this pull request Sep 12, 2020
@@ -689,6 +693,7 @@ const makeMigrationCall = (
successMsg,
errorMsg,
shouldSkipSchemaReload,
false,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beerose Could you please add this change for the very next update?
Related to #5436

@beerose beerose mentioned this pull request Nov 10, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console Related to console
Projects
None yet
5 participants