mejoras en el modelo de clarificacion de productos
This commit is contained in:
15
db/migrations/20260118100000_reco_rules_product_ids.sql
Normal file
15
db/migrations/20260118100000_reco_rules_product_ids.sql
Normal 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;
|
||||
Reference in New Issue
Block a user