-- ============================================================================
-- Copyright (C) 2026 Alles Watt lauft
-- ============================================================================

ALTER TABLE llx_kundenkarte_favorite_products ADD UNIQUE INDEX uk_kundenkarte_favprod_soc_product (fk_soc, fk_product, entity);

ALTER TABLE llx_kundenkarte_favorite_products ADD INDEX idx_kundenkarte_favprod_fk_soc (fk_soc);
ALTER TABLE llx_kundenkarte_favorite_products ADD INDEX idx_kundenkarte_favprod_fk_product (fk_product);
ALTER TABLE llx_kundenkarte_favorite_products ADD INDEX idx_kundenkarte_favprod_active (active);

ALTER TABLE llx_kundenkarte_favorite_products ADD CONSTRAINT fk_kundenkarte_favprod_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
ALTER TABLE llx_kundenkarte_favorite_products ADD CONSTRAINT fk_kundenkarte_favprod_fk_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
