budget-view-finance/supabase/functions/update-register-function-sql/index.ts
gpt-engineer-app[bot] e75d0058d6 Run SQL to add WhatsApp column
Adds the WhatsApp column to the usuarios table in the Supabase database.
2025-05-23 16:11:31 +00:00

27 lines
745 B
TypeScript

// This is a temporary solution to update the database function
// You can run this SQL in the Supabase SQL Editor:
//
// CREATE OR REPLACE FUNCTION public.registrar_usuario(
// nome text,
// empresa text,
// email text,
// senha text,
// whatsapp text
// ) RETURNS uuid
// LANGUAGE plpgsql
// SECURITY DEFINER
// AS $function$
// DECLARE
// novo_usuario_id UUID;
// BEGIN
// -- Inserir novo usuário com senha hash
// INSERT INTO public.usuarios (nome, empresa, email, senha, whatsapp)
// VALUES (nome, empresa, email, crypt(senha, gen_salt('bf')), whatsapp)
// RETURNING id INTO novo_usuario_id;
//
// -- Retorna o ID do usuário criado sem criar tabela individual
// RETURN novo_usuario_id;
// END;
// $function$