Ir al contenido

Crear Artículo

Publica un nuevo artículo en la base de conocimiento.

  1. Ve a Base de Conocimiento → ”+ Nuevo artículo”
  2. Selecciona la categoría y subcategoría
  3. Escribe el título y contenido con el editor enriquecido
  4. Añade imágenes, vídeos o archivos adjuntos
  5. Configura el estado: Borrador / Publicado / Archivado
  6. Haz clic en “Publicar”
Detalles técnicos — Crear artículo
kb_articles (
id UUID PRIMARY KEY,
title TEXT NOT NULL,
content TEXT NOT NULL,
category_id UUID REFERENCES kb_categories(id),
author_id UUID REFERENCES auth.users(id),
status TEXT CHECK (status IN ('draft','published','archived')),
views INTEGER DEFAULT 0,
helpful_votes INTEGER DEFAULT 0,
not_helpful_votes INTEGER DEFAULT 0,
published_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now()
);
kb_categories (
id UUID PRIMARY KEY,
name TEXT NOT NULL,
description TEXT,
icon TEXT,
sort_order INTEGER DEFAULT 0,
parent_id UUID REFERENCES kb_categories(id)
);
-- Índice de búsqueda en título y contenido
CREATE INDEX kb_articles_search_idx ON kb_articles
USING gin(to_tsvector('spanish', title || ' ' || content));
-- Búsqueda
SELECT * FROM kb_articles
WHERE to_tsvector('spanish', title || ' ' || content)
@@ plainto_tsquery('spanish', 'factura rectificativa')
AND status = 'published'
ORDER BY views DESC;