netgescon-master/_BACKUP_OLD_netgescon-laravel_INACTIVE/verify-quick.sh

34 lines
918 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "🔍 VERIFICA SISTEMA NETGESCON"
echo "============================"
echo "1⃣ Test struttura database..."
mysql -u root -p -e "DESCRIBE netgescon.amministratori;" | grep codice
echo "2⃣ Test creazione amministratore..."
php artisan tinker --execute="
\$user = \App\Models\User::first();
if (\$user) {
\$admin = new \App\Models\Amministratore([
'nome' => 'Test',
'cognome' => 'Verifica',
'user_id' => \$user->id,
'codice_amministratore' => 'VER' . rand(100,999)
]);
\$admin->save();
echo 'Codice generato: ' . \$admin->codice_univoco;
\$admin->delete();
} else {
echo 'Creo utente test...';
\$user = \App\Models\User::create([
'name' => 'Test User',
'email' => 'test@test.com',
'password' => bcrypt('password')
]);
echo 'Utente creato con ID: ' . \$user->id;
}
"
echo "✅ Verifica completata!"