mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Update `sql/create_avoirs_production.sql` to include checks for dependent tables and add indexes. Add `sql/debug_simple.sql` for step-by-step table debugging. 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
26 lines
1003 B
SQL
26 lines
1003 B
SQL
-- 🔍 DIAGNOSTIC SIMPLE - Une requête à la fois
|
|
-- Copiez chaque ligne séparément pour voir les résultats précis
|
|
|
|
-- ÉTAPE 1: La table existe-t-elle ?
|
|
SELECT EXISTS (
|
|
SELECT FROM information_schema.tables
|
|
WHERE table_schema = 'public'
|
|
AND table_name = 'avoirs'
|
|
) AS table_avoirs_exists;
|
|
|
|
-- ÉTAPE 2: Quelles sont les colonnes ?
|
|
SELECT column_name, data_type, is_nullable
|
|
FROM information_schema.columns
|
|
WHERE table_name = 'avoirs'
|
|
AND table_schema = 'public'
|
|
ORDER BY ordinal_position;
|
|
|
|
-- ÉTAPE 3: Les tables liées existent-elles ?
|
|
SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = 'suppliers') AS suppliers_exists,
|
|
EXISTS (SELECT FROM information_schema.tables WHERE table_name = 'groups') AS groups_exists,
|
|
EXISTS (SELECT FROM information_schema.tables WHERE table_name = 'users') AS users_exists;
|
|
|
|
-- ÉTAPE 4: Test basique d'insertion
|
|
SELECT COUNT(*) FROM suppliers;
|
|
SELECT COUNT(*) FROM groups;
|
|
SELECT COUNT(*) FROM users LIMIT 1; |