-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Applying migrations not working as expected #3633
Comments
I think I had that same issue as my issue as I described in #3632. I just saw it once and forgot exactly what the error was. I'm not sure if its the same bug I encountered, but if it is, basically the answer to solving this is to only have one folder in |
@joshuarobs Hi, in my case it was a fresh hasura instance with just two tables. I did a single backup, meaning my migrations folder had just one migration directory |
Does this mean that you applied the down migration or you deleted the tables manually?
This error says the function already exists in the database. So, the clean-up was not proper? |
@shahidhk I´ve just removed the tables from within the Hasura dashboard, maybe I should test it with a clean postgres installation instead. thank you |
@mklueh I'm closing this issue. Feel free to re-open if you'd like to add something 🙂 |
Execute this in the hasura SQL console if you run into this |
Getting same error. Trying to delete function as suggested by @kuryaki throws
|
As of 24 May 2020, I still encountered this same error when trying to apply a migration to a new Hasura server that I started locally on Docker, on Hasura server version 1.2.1. I tried using the answer that @kuryaki suggested, but it didn't work for me. That may work for a Hasura server that already has data in it. But mine was a clean slate. Calling Basically, the answer that I posted earlier on 4 Jan is the solution that worked for me. Again. That's not to say that kuryaki's answer won't work, it may for some situations. But for those in my situation, my answer worked again. What's my answer? tl;dr: Ensure you have only 1 "init" migration in your |
I have the same issue as @amitava82 and I only have 1 migration called "init". @marionschleifer Why did you close this issue? Can you please reopen because I don't see any solution here yet. |
I'm running into this issue as well. Tried @kuryaki's solution and received the same error that @amitava82 is getting: Also tried @joshuarobs solution with only having 1 "init" migration. Any other thoughts, ideas, or workarounds? Update: I was able to work around the issue by creating a fresh Hasura Heroku install of the remote I was trying to push the migration to, and both the |
Encountered the same issue on a brand new project from the beginning. |
Also encountered this. Possibly caused by me manually uploading the metadata file from the console instead of the CLI? Going to try it fresh. Running a fresh database on digitalocean from the digitalocean link |
Any update on this issue? |
I've also ran into this issue. Is it possible this is caused by residual data left on the server? The docs don't say how to reset migration history on server. https://hasura.io/docs/latest/graphql/core/migrations/advanced/resetting-migrations.html When I run
|
I encountered this issue when created a new server instance, I have an existing database that is used by hasura on previous server and when I created a new instance to use the same database the error happens
|
@aindong I had same issue a v1 hasura db moved to hasura v2.
|
I've used CASCADE in the drop query, maybe it helps you (eg):
|
I'm seeing the same bug. It's reproducible for me whenever I delete my postgres database and start fresh. I haven't done anything fishy outside of hasura that might mess up my migrations. EDIT: Figured out the issue. I ran |
This works well sir, thanks for the solution. I have just one note to solve this problem. You have to do this where you apply the migration and metadata It will work if you do like this. |
Closing this due to low activity, and resolution paths being present. Please create a new issue if something like this issue still occurs. |
I´m trying a simple backup / restore on the same database with hasura CLI
After creating the migrations, I´ve deleted all my tables in Hasura and wanted to recreate them by applying the migrations, but I´m running into this issue:
Are there any restrictions applying the migrations that I´m not aware of?
The text was updated successfully, but these errors were encountered: