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

ALTER TABLE llx_kundenkarte_equipment ADD INDEX idx_kundenkarte_equipment_carrier (fk_carrier);
ALTER TABLE llx_kundenkarte_equipment ADD INDEX idx_kundenkarte_equipment_type (fk_equipment_type);
ALTER TABLE llx_kundenkarte_equipment ADD INDEX idx_kundenkarte_equipment_status (status);

ALTER TABLE llx_kundenkarte_equipment ADD CONSTRAINT fk_kundenkarte_equipment_carrier FOREIGN KEY (fk_carrier) REFERENCES llx_kundenkarte_equipment_carrier (rowid) ON DELETE CASCADE;
ALTER TABLE llx_kundenkarte_equipment ADD CONSTRAINT fk_kundenkarte_equipment_type FOREIGN KEY (fk_equipment_type) REFERENCES llx_kundenkarte_equipment_type (rowid) ON DELETE RESTRICT;
