SupabaseS
Supabase4y ago
Nin

Migrations fail without feedback

The migrations that work on my local DB aren't being pushed and I have no feedback as to why.

Below is the migration file it's currently erroring on:

CREATE OR REPLACE FUNCTION public.tid(
    )
    RETURNS uuid
    LANGUAGE 'sql'
    COST 100
    STABLE PARALLEL UNSAFE
AS $BODY$
select
      coalesce(
        (nullif(current_setting('request.jwt.claims', true), '')::jsonb #>> '{user_metadata, tenant_id}')
    )::uuid
$BODY$;

ALTER FUNCTION public.tid()
    OWNER TO supabase_auth_admin;

GRANT EXECUTE ON FUNCTION public.tid() TO PUBLIC;

GRANT EXECUTE ON FUNCTION public.tid() TO anon;

GRANT EXECUTE ON FUNCTION public.tid() TO authenticated;

GRANT EXECUTE ON FUNCTION public.tid() TO dashboard_user;

GRANT EXECUTE ON FUNCTION public.tid() TO service_role;

GRANT EXECUTE ON FUNCTION public.tid() TO supabase_auth_admin;

COMMENT ON FUNCTION public.tid()
    IS 'Returns the currently logged in users tenant id';
Was this page helpful?