Closed PlasticLizard closed 5 months ago
Found a solution to the underlying issue, but not the rollback on caught exception.
I'm using Supabase - extensions there are installed in an extensions schema, not in public.
I was able to solve this by changing the search path in my connection string to medusa,extensions
Hey, thanks for the report! Since v2 brought a lot of architectural and API changes on the backend, we will be closing this ticket since it no longer applies to our new setup, or the issue has already been fixed. If you are still facing issues with v1, please open a new ticket and we will address it as soon as possible. Thanks! 🙏
Bug report
Describe the bug
After upgrading to v1.12.0 using a custom schema (set via connection string per docs), migrations do not run. I get the following error:
In my case, pg_trgm IS installed. But I think the problem is probably that the extension is installed in public, and maybe the search path is limited exclusively to my custom schema.
I manually created all the indexes, assuming the IF NOT EXISTS would prevent the error, but somehow it did not.
But that isn't the main issue I'm reporting, because I can manually create the indexes. The main issue is that the try/catch in the migration doesn't allow the migration to be skipped as intended because the transaction gets aborted.
I think the only workaround I have at the moment will be to manually run the SQL found in the migrations, and also manually insert the relevant rows into the migrations table, which will work for dev but will be kind of hairy in staging/prod.
System information
Medusa version (including plugins): 1.12.0 Node.js version: 16.15.0 Database: Postgres 15 Operating system: OSX Browser (if relevant):
Steps to reproduce the behavior
Expected behavior
Migrations succeed