<?php
require 'config/database.php';
$pdo = getDBConnection();

echo "=== INDEXES ON inventario_sucursal ===" . PHP_EOL;
$stmt = $pdo->query("SHOW INDEX FROM `inventario_sucursal`");
print_r($stmt->fetchAll());

echo "=== COUNT OF DUPLICATES ===" . PHP_EOL;
$stmt = $pdo->query("SELECT producto_id, sucursal_id, COUNT(*) as cnt FROM inventario_sucursal GROUP BY producto_id, sucursal_id HAVING cnt > 1");
print_r($stmt->fetchAll());
