refactor: update OTP system to support user-specific verification tables with legacy encryption and multi-role authentication.

This commit is contained in:
Hamza-Ayed
2026-04-23 17:03:38 +03:00
parent d64a423db9
commit 098aa9ad37
10 changed files with 649 additions and 189 deletions

View File

@@ -51,6 +51,15 @@ return new class extends Migration
});
}
// Add api_key and api_secret to users table (Service Customers/Employees)
if (!Schema::connection('primary')->hasColumn('users', 'api_key')) {
Schema::connection('primary')->table('users', function (Blueprint $table) {
$table->string('api_key', 64)->nullable()->after('user_type');
$table->string('api_secret', 128)->nullable()->after('api_key');
$table->index('api_key', 'idx_users_api_key');
});
}
// ══════════════════════════════════════════════
// MISSING INDEXES — Performance optimization
// ══════════════════════════════════════════════