Saltar a contenido

Especificación Técnica: cat_generos

Esquema: core.identidad
Base de Datos: core
Servicio: svc-identidad
Propósito: Catálogo global de géneros para el perfil de personas.


1. Justificación y Mejoras de Arquitectura

  • Catálogo global sin contexto empresarial.

2. Definiciones de Implementación

Table core.identidad.cat_generos {
    id                         uuid          [pk, default: `gen_random_uuid()`]
    nombre                     varchar(100)  [not null]

    // Auditoría General
    is_activo               boolean       [not null, default: `true`, note: 'Estado lógico del registro']
    created_at              timestamptz   [not null, default: `now()`, note: 'Fecha de creación']
    updated_at              timestamptz   [not null, default: `now()`, note: 'Fecha de última actualización']
    deleted_at              timestamptz   [note: 'Fecha de eliminación lógica']
    created_by              uuid          [note: 'Usuario creador']
    updated_by              uuid          [note: 'Usuario modificador']
}
CREATE TABLE IF NOT EXISTS core.identidad.cat_generos (
    id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
    nombre VARCHAR(100) NOT NULL,

    -- Auditoría General
    is_activo BOOLEAN NOT NULL DEFAULT true,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    deleted_at TIMESTAMPTZ,
    created_by UUID,
    updated_by UUID
);

-- Comentarios
COMMENT ON COLUMN core.identidad.cat_generos.nombre IS 'Nombre del género';