mejoras en el modelo de clarificacion de productos

This commit is contained in:
Lucas Tettamanti
2026-01-17 06:31:49 -03:00
parent 63b9ecef61
commit 204403560e
24 changed files with 1940 additions and 873 deletions

View File

@@ -0,0 +1,15 @@
-- migrate:up
-- Agregar columnas para asociación directa producto-producto
alter table product_reco_rules
add column if not exists trigger_product_ids integer[] not null default '{}',
add column if not exists recommended_product_ids integer[] not null default '{}';
-- Índice GIN para búsqueda rápida por trigger_product_ids
create index if not exists product_reco_rules_trigger_ids_idx
on product_reco_rules using gin (trigger_product_ids);
-- migrate:down
drop index if exists product_reco_rules_trigger_ids_idx;
alter table product_reco_rules
drop column if exists trigger_product_ids,
drop column if exists recommended_product_ids;