SELECT table_name FROM information_schema.tables
WHERE table_schema = DATABASE() AND table_name IN (
  'qipai_third_party_configs', 'qipai_third_party_mappings',
  'qipai_group_vouchers', 'qipai_group_redemptions', 'qipai_direct_bookings'
) ORDER BY table_name;

SELECT table_name, index_name FROM information_schema.statistics
WHERE table_schema = DATABASE()
  AND ((table_name = 'qipai_group_vouchers'
        AND index_name = 'uq_qipai_group_voucher_hash')
    OR (table_name = 'qipai_group_redemptions'
        AND index_name IN (
          'uq_qipai_group_redemption_request', 'uq_qipai_group_redemption_voucher'
        ))
    OR (table_name = 'qipai_direct_bookings'
        AND index_name IN (
          'uq_qipai_direct_booking_event', 'uq_qipai_direct_booking_no'
        ))
    OR (table_name = 'qipai_third_party_mappings'
        AND index_name = 'uq_qipai_third_party_mapping_external'))
GROUP BY table_name, index_name ORDER BY table_name, index_name;

SELECT version, name FROM qipai_schema_migrations WHERE version = '2026062217';
