O erro persiste porque o banco de dados precisa ser atualizado com as colunas exatas (incluindo letras maiúsculas/minúsculas) que o sistema espera.
Por favor, execute o comando SQL completo abaixo no seu SQL Editor do Supabase:
-- 1. Garantir que a tabela e as colunas existam com os nomes corretos
DO $$
BEGIN
-- Criar tabela se não existir
IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'public' AND table_name = 'talks') THEN
CREATE TABLE public.talks (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
END IF;
-- Adicionar/Verificar colunas (usando aspas para manter camelCase)
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'format') THEN ALTER TABLE public.talks ADD COLUMN format TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'theme') THEN ALTER TABLE public.talks ADD COLUMN theme TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'status') THEN ALTER TABLE public.talks ADD COLUMN status TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'date') THEN ALTER TABLE public.talks ADD COLUMN date TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'startTime') THEN ALTER TABLE public.talks ADD COLUMN "startTime" TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'endTime') THEN ALTER TABLE public.talks ADD COLUMN "endTime" TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'stage') THEN ALTER TABLE public.talks ADD COLUMN stage TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'location') THEN ALTER TABLE public.talks ADD COLUMN location TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'description') THEN ALTER TABLE public.talks ADD COLUMN description TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'bio') THEN ALTER TABLE public.talks ADD COLUMN bio TEXT; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'speakers') THEN ALTER TABLE public.talks ADD COLUMN speakers JSONB DEFAULT '[]'::jsonb; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'relatedThemes') THEN ALTER TABLE public.talks ADD COLUMN "relatedThemes" JSONB DEFAULT '[]'::jsonb; END IF;
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'talks' AND column_name = 'addBottomGap') THEN ALTER TABLE public.talks ADD COLUMN "addBottomGap" BOOLEAN DEFAULT FALSE; END IF;
END $$;
-- 2. Recarregar o cache do esquema (Obrigatório)
NOTIFY pgrst, 'reload schema';