-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Migrations with default value of column are not applied correctly #7776
Comments
Hi @naokomura. Thanks for reporting this—I am experiencing this, too. I am on v2.0.3. Can you please clarify what you mean by this?
Thank you, |
Looks like I am able to solve this issue by any of the following methods:
OR
|
@dminkovsky @naokomura I've also experienced this with Hasura v2.0.10-cloud.1. After applying new migrations/metadata to a production instance from the Hasura CLI I had to "Reload metadata" with "Reload all databases". I'm also unsure why. |
correct however the poorly documented solution is to run |
There's possible overlap between this issue and mine (#8245) Whereas this issue focuses on hasura migrations not immediately reloading metadata, I request that the inconsistency flag be raised. But in the end we both just want hasura to support external modifications to the database sources. |
Version Information
Environment
OSS (used in Docker Compose)
What is the expected behaviour?
migrate apply
command correctly execute SQL commands with default values.Keywords
column default value, migrate column default, no such column exists
What is the current behaviour?
Running the following SQL command of migration, Hasura Console will display an alert saying
Browse query failed! no such column exists : "is_active"
, and the data in this table will no longer be displayed in Hasura Console.This example is automatically generated by Hasura Console (provided by
hasura console
command).However, after checking the data in this table using the Raw SQL feature of Hasura Console, I confirmed
is_active
column existence and each field hadf
literal value representingfalse
.Accessing this column once in Hasura Console seems to fix this problem, but I will not be able to request this column in GraphQL until it is fixed.
This is a slightly tricky problem, especially if not enabled Hasura Console in a production environment.
How to reproduce the issue?
hasura console
commandmigrate delete
commandmigrations
directorymigrate apply
commandPlease provide any traces or logs that could help here.
Message of error notification from Hasura Console
Logs of hasura/graphql-engine on Docker
Any possible solutions?
Access the column added after the migration on Hasura Console.
For example, add comments to the column, run SQL commands like
select is_active from users
, etc.Can you identify the location in the source code where the problem exists?
No, I can't identify the problem, probably.
If the bug is confirmed, would you be willing to submit a PR?
If the cause exists in the Hasura Console(served by the Hasura CLI), I may be able to submit a PR.
The text was updated successfully, but these errors were encountered: