-- liquibase formatted sql

-- changeset codex:add_index_stock_in_line_job_order_deleted_20260417
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'stock_in_line' AND INDEX_NAME = 'idx_stock_in_line_job_order_deleted'
CREATE INDEX idx_stock_in_line_job_order_deleted
    ON stock_in_line (jobOrderId, deleted, id);

-- changeset codex:add_index_productprocess_deleted_date_joborder_priority_20260417
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'productprocess' AND INDEX_NAME = 'idx_productprocess_deleted_date_joborder_priority'
CREATE INDEX idx_productprocess_deleted_date_joborder_priority
    ON productprocess (deleted, date, jobOrderId, productionPriority);

-- changeset codex:add_index_pick_order_jo_deleted_created_20260417
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM information_schema.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'pick_order' AND INDEX_NAME = 'idx_pick_order_jo_deleted_created'
CREATE INDEX idx_pick_order_jo_deleted_created
    ON pick_order (joId, deleted, created);
