graphql-engine
graphql-engine copied to clipboard
Renaming column from console partially succeeds even when it would result in inconsistency
Version Information
Server Version: Many versions (Tested on 2.8.4, 2.12.0-beta.1)
Environment
OSS
What is the current behaviour?
Hasura does not completely prevent a column from being renamed when it would result in inconsistent metadata. Hasura shows the message cannot continue due to newly found inconsistent metadata
which indicates that the action didn't succeed but it still renames the table. In other words the renaming partially succeeds.
Once this happens, the queries do not work either with the new column name or the old column name (shown in screenshots). Hasura doesn't report any metadata inconsistencies either so everything seems normal even when it's not.
What is the expected behaviour?
The renaming must either completely succeed or completely fail.
How to reproduce the issue?
- Create and track the following table
CREATE TABLE sometable(id SERIAL PRIMARY KEY, val TEXT);
- Track the following query as REST API (/api/rest/someresource)
query SomeQuery {
sometable {
id
val
}
}
- Rename column
val
toval2
.
Screenshots or Screencast




Any possible solutions?
Reloading the metadata with 'Reload all databases' enabled fixes the problem. This also shows the inconsistency which needs to be fixed.
Keywords
renaming