Migrations in progress, please do NOT stop the process.
Starting migration CreateWorkflowBuilderSessionTable1770291236000
Migration “CreateWorkflowBuilderSessionTable1770291236000” failed, error: function uuid_generate_v4() does not exist
There was an error running database migrations
function uuid_generate_v4() does not exist
Information on your n8n setup
n8n version: n8nio/n8n:latest (2.10.2)
Database (default: SQLite): I think it is Supabase
I noticed that this error may be happening because, in Supabase, the uuid_generate_v4 function lives inside the extensions schema, and that can cause Postgres not to find it during migrations if the connection’s search_path doesn’t include that schema. The Supabase documentation itself shows that the uuid‑ossp extension is installed in the extensions schema by default, so the function does exist, but the environment may not be able to see it if the search_path is different.
What worked for me was adjusting the search_path of the user that n8n uses in the database like this: alter role postgres set search_path = public,extensions; After that, I restarted the containers and the migration completed without errors. This may work for your case as well
CREATE OR REPLACE FUNCTION public.uuid_generate_v4()
RETURNS uuid
LANGUAGE sql
AS $$
SELECT extensions.uuid_generate_v4();
$$;
The problem is that for some reason n8n now only reads the public schema so u need to move the extension or create a function in the public schema that call the extension in the extension schema as I did.
Should I run this in postgres instance? If I run in postgres, I receive the error - “schema “extensions” does not exist”. Are we copying from supabase to postgres or within postgres?
It depends on your case, in my case I have the function uuid_generate_v4 in my extensions schema that is where supabase save the extensions but if u re not using supabase maybe u dont even have the function in any of ur schemas so u have create it from zero in ur public schema