-- 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;
