-- ACE2 - Consultas de respaldo de clasificaciones ACE actual
-- Ejecutar antes de vaciar la base.
-- En phpMyAdmin, exportar el resultado de cada SELECT como CSV.

-- 1) Descripciones unicas y clasificacion humana/automatica.
SELECT
    id AS legacy_description_id,
    source_field,
    raw_description,
    normalized_description,
    description_hash,
    category_id,
    product_id,
    brand,
    model,
    dimensions_text,
    packaging_text,
    unit_measure,
    review_status,
    suggested_category_id,
    suggested_product_id,
    suggested_brand,
    suggested_model,
    suggested_dimensions_text,
    suggested_packaging_text,
    suggested_unit_measure,
    auto_classification_status,
    classified_by_rule_id,
    classified_by_alias_id,
    notes
FROM market_unique_descriptions;

-- 2) Categorias de mercado.
SELECT *
FROM market_product_categories;

-- 3) Productos canonicos.
SELECT *
FROM market_products;

-- 4) Aliases de productos.
SELECT *
FROM market_product_aliases;

-- 5) Reglas de clasificacion.
SELECT *
FROM market_classification_rules;

-- 6) Diccionario.
SELECT *
FROM market_dictionary_terms;

-- 7) Palabras clave historicas.
SELECT *
FROM market_description_keywords;

-- 8) Relacion cliente-categoria.
SELECT *
FROM client_market_categories;

-- 9) Palabras clave cliente-mercado.
SELECT *
FROM client_market_keywords;
