mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Add SQL script with diagnostic queries to test table existence, manual record insertion, and record deletion, ensuring proper database functionality. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/2Jd7tYp
32 lines
902 B
SQL
32 lines
902 B
SQL
-- 🔍 TEST DE DIAGNOSTIC COMPLET
|
|
-- Vérifiez que tout fonctionne côté base de données
|
|
|
|
-- 1. La table existe-t-elle vraiment ?
|
|
SELECT COUNT(*) as table_count
|
|
FROM information_schema.tables
|
|
WHERE table_name = 'avoirs' AND table_schema = 'public';
|
|
|
|
-- 2. Test d'insertion manuelle pour voir si ça marche
|
|
INSERT INTO avoirs (
|
|
supplier_id,
|
|
group_id,
|
|
invoice_reference,
|
|
amount,
|
|
comment,
|
|
commercial_processed,
|
|
created_by
|
|
) VALUES (
|
|
1, -- Remplacez par un ID supplier existant
|
|
1, -- Remplacez par un ID group existant
|
|
'TEST-MANUEL-' || EXTRACT(EPOCH FROM NOW()),
|
|
25.99,
|
|
'Test diagnostic manuel',
|
|
false,
|
|
'admin' -- Remplacez par un user_id existant
|
|
) RETURNING id, created_at;
|
|
|
|
-- 3. Vérifiez le résultat
|
|
SELECT COUNT(*) as total_avoirs FROM avoirs;
|
|
|
|
-- 4. Supprimez le test
|
|
DELETE FROM avoirs WHERE comment = 'Test diagnostic manuel'; |