-
Notifications
You must be signed in to change notification settings - Fork 2.8k
allow renaming tables, columns and relationships (close #79) #1542
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
Conversation
…o rename-tab-col Resolved Conflicts: server/src-lib/Hasura/RQL/DDL/Schema/Table.hs server/src-lib/Hasura/RQL/DDL/Schema/Table/Internal.hs
Resolved Conflicts: server/src-lib/Hasura/GraphQL/Schema.hs
Resolve Conflicts: server/src-lib/Hasura/RQL/DDL/Schema/Diff.hs server/src-lib/Hasura/RQL/DDL/Schema/Table.hs
Resolve Conflicts: server/graphql-engine.cabal server/src-exec/Ops.hs server/src-lib/Hasura/GraphQL/Schema.hs server/src-lib/Hasura/RQL/DDL/Metadata.hs server/src-lib/Hasura/RQL/DDL/Permission.hs server/src-lib/Hasura/RQL/DDL/Schema/Diff.hs server/src-lib/Hasura/RQL/DDL/Schema/Table.hs server/src-lib/Hasura/RQL/DDL/Utils.hs server/src-lib/Hasura/RQL/Types/SchemaCache.hs server/src-lib/Hasura/Server/App.hs server/src-lib/Hasura/Server/Init.hs server/src-lib/Hasura/Server/Version.hs server/src-rsr/init_views.sql server/test/Spec.hs
…d permissions table
Resolve Conflicts: server/src-exec/Ops.hs server/src-rsr/migrate_from_8_to_9.sql
-> Internal refactor TODO:- -> add tests
-> Tests for rename column, table and relationship
-> Squashed bugs reported by rishi
|
Review app for commit ede67cc deployed to Heroku: https://hge-ci-pull-1542.herokuapp.com |
|
Review app for commit 0078307 deployed to Heroku: https://hge-ci-pull-1542.herokuapp.com |
-> Improve renaming table logic
Resolve Conflicts: server/src-lib/Hasura/RQL/DDL/Schema/Table.hs
|
Review app for commit 7de6809 deployed to Heroku: https://hge-ci-pull-1542.herokuapp.com |
…79-renaming Resolve Conflicts: console/src/components/Services/Data/TableModify/Modify.scss console/src/components/Services/Data/TableModify/ModifyTable.js console/src/components/Services/Data/TableModify/ModifyView.js console/src/components/Services/Data/TableRelationships/Relationships.js console/src/components/Services/Data/TableRelationships/RelationshipsView.js console/src/helpers/semver.js server/src-exec/Ops.hs
…ne into issue-79-renaming
|
Review app for commit 0413380 deployed to Heroku: https://hge-ci-pull-1542.herokuapp.com |
|
Review app for commit 8986e18 deployed to Heroku: https://hge-ci-pull-1542.herokuapp.com |
|
Review app https://hge-ci-pull-1542.herokuapp.com is deleted |
### What This PR rewrites how argument and field presets are handled to address two final bugs: * If you define field presets on TypePermissions and that type is used nested inside an argument's type somewhere, but as an array of the object type, the field presets will not be applied * If you define field presets on TypePermissions and your types are recursive, field presets will only be applied to the first layer and not past the point where the types recur These bugs are caused by the argument presets being precalculated during metadata resolve into field_paths that are used to poke the preset values onto the arguments. However, this approach fundamentally doesn't work, since recursive types make any field path infinitely long. The only way to handle this correctly is to walk the types at query time, along with the argument values provided by the user, and apply the field presets. This allows you to walk the types recursively, and is not infinite, since the recursion is bounded by the value provided by the user. Walking the types also allows correct navigation of arrays (which field paths didn't), so the presetting can descend into arrays and apply presets to the objects inside. ### How The argument_presets stage has been delete from metadata_resolve. Instead, argument and field presetting is performed at query time in the plan stage. This required access to metadata to perform, so metadata types have been plumbed down into the GraphQL IR processing stage and then into the argument planning code. Please look at the comments I've submitted below for further commentary. --------- Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com> V3_GIT_ORIGIN_REV_ID: 362a1d5c2943c2a3837424c327b3e4defb0d600c
### What Moves the changelog entries from #1542 into unreleased. V3_GIT_ORIGIN_REV_ID: 10189534a4e68f91f88c928155b2308f9689540f
Description
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Related Issue
close #79
Solution and Design
GraphQL Engine allows renaming tables and columns through
run_sqlqueryEx:-
Support renaming relationship via
rename_relationshipquery typeEx:-
Server updates all related metadata whenever any rename occurs
Internal code changes
..DDL/Relationship.hsare moved to..DDL/Relationship/Types.hs..DDL/Schema/Rename.hsOps.hstoMigrate.hsType
Checklist: