-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Trigger and function not defined in right order using db diff #1113
Comments
I can confirm this behavior, with My application has two triggers on |
I had the same issue. I filed a ticket. this from the support engineering team - |
The way db diff works is by diffing schemas one by one in alphabetical order. I'm not sure if there's an easy way to fix this problem. Meanwhile you can work around it by specifying the order of schema explicitly. For eg. supabase db diff -f public_changes -s public
supabase db diff -f auth_changes -s auth If it helps, you can also combine them into a single migration afterwards by concatenating the generated migration files. |
I faced this with the latest version of |
I also experienced this with |
Bug report
Describe the bug
When having a trigger on your database that calls a certain trigger and you run
supabase db diff
to generate a migration, it will first output the trigger and then the function. When running this code (migration), it will throw an errorfunction (...) does not exist
. The simple fix is to manually edit the output and put the trigger creation after the function creation.To Reproduce
supabase db diff -f "add_automatic_profile_creation"
supabase db reset
Error: ERROR: function handle_new_user() does not exist (SQLSTATE 42883)
Expected behavior
The migration should simply succeed
System information
Additional context
I created the function and trigger through the studio and later manipulated them through DBeaver. Can't imagine this has any effect though
The text was updated successfully, but these errors were encountered: