# NGBVD Migration Key Length Fix

This patch fixes MySQL/MariaDB key length failures caused by indexed VARCHAR(255) columns under utf8mb4 on older database configurations.

Changed indexed columns to safe lengths:
- api_clients.client_key: 100
- integration_logs.integration_name: 150
- integration_logs.case_reference: 150
- user_data_scopes.scope_value: 100

If the previous failed migration left a partial api_clients table, drop the partially-created table before rerunning the migration:

DROP TABLE IF EXISTS api_clients;
DROP TABLE IF EXISTS integration_logs;
DROP TABLE IF EXISTS user_data_scopes;

Then rerun:
php artisan migrate --path=database/migrations/2026_06_04_000100_create_api_clients_integration_logs_and_user_scopes.php
