-
Notifications
You must be signed in to change notification settings - Fork 229
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
supabase db diff fails in several cases #369
Comments
Thank you for reporting this bug. This turns out to be an issue with applying migrations where we used batched query locally. I've switched to simple query in v1.0.2 which sends the migration script as one string to local Postgres. #373 Let me know if the latest cli works for you. |
Hi @sweatybridge I installed v1.0.3 I can generate and apply migrations (tested locally) when using migra. The default diff command still gives me an error.
|
Thanks for confirming. I believe the default diff was broken due to a corrupted image when we transferred to ECR. I will work on a fix. |
FYI |
This was happening for me. All good on the JSON error. But now it's stuck here. Any help please? PS C:\0xhashlabs\prod\hashmail-supabase> supabase db remote commit ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% |
@rbkayz sorry I was a little caught up with fixing other issues. Is this still happening with v1.1.5? We updated initial schema to be consistent with hosted Supabase. If doesn't help, please open a new issue and tell us more about your schema to help us investigate further. |
We're all good. 1.15 works great. Q though - is there a way to set a flag on the diff so that it only checks specific schemas? Generally I only need to diff public, auth and storage The others like graphql, extensions add way too much random noise to the diff |
Hi @rbkayz , yes you can use |
Note that you shouldn't diff |
Fair point. It's just that I have some RLS policies in storage. And some triggers in auth.users on insert Which I need to diff in migrations so that it gets automatically pushed to my staging and prod projects Would you recommend a better way please? |
Hmm, I think if you only keep the storage RLS policies and auth.users triggers, you should be fine 👍 |
Bug report
Describe the bug
supabase db diff with simple setup
Migra fails with functions that have variable declarations.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
When I create a new project and add a function (taken from the docs) the diff fails.
I ran the following steps:
Connect to the DB using TablePlus and add the following table and functions:
Then run the default diff
$ supabase db diff > Error: unexpected end of JSON input
Adding
--debug
adds no further output.If I run the diff with the --use-migra option it works.
But when I add a function with a variable declaration the diff fails as well.
Expected behavior
The diff should be created without error
System information
The text was updated successfully, but these errors were encountered: