-- ScanStation — migration: add composite indexes for performance
-- Run this on existing installations (tables already exist).
-- Safe to run multiple times — uses IF NOT EXISTS pattern via CREATE INDEX.
-- Date: 2026-04-08

-- llx_scanstation_job_tracking
ALTER TABLE llx_scanstation_job_tracking
    ADD INDEX IF NOT EXISTS idx_ss_jt_mo_type      (fk_mo, scan_type),
    ADD INDEX IF NOT EXISTS idx_ss_jt_mo_user_date (fk_mo, fk_user, date_stamp);

-- llx_scanstation_log
ALTER TABLE llx_scanstation_log
    ADD INDEX IF NOT EXISTS idx_ss_log_mo_user (fk_mo, fk_user);
