mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-22 14:38:19 +02:00
Add missing email column to suppliers to fix order and delivery errors
Adds the 'email' column to the 'suppliers' table via SQL script to resolve 500 errors on `/api/orders` and `/api/deliveries` caused by missing schema information required by Drizzle ORM. Replit-Commit-Author: Agent Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/FyjZ5oh
This commit is contained in:
1 parent
c79ac79a91
commit
c8a8b138e7
6 files changed
+605
No files matched your search
@@ -0,0 +1,50 @@
|
||||
-- Fix pour ajouter la colonne email manquante dans la table suppliers en production
|
||||
-- Cette colonne est définie dans le schéma Drizzle mais n'existe pas en base
|
||||
|
||||
BEGIN;
|
||||
|
||||
-- Vérifier si la colonne email existe déjà
|
||||
DO $$
|
||||
BEGIN
|
||||
-- Essayer d'ajouter la colonne email si elle n'existe pas
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'suppliers'
|
||||
AND column_name = 'email'
|
||||
AND table_schema = 'public'
|
||||
) THEN
|
||||
ALTER TABLE suppliers ADD COLUMN email VARCHAR;
|
||||
RAISE NOTICE 'Colonne email ajoutée à la table suppliers';
|
||||
ELSE
|
||||
RAISE NOTICE 'Colonne email existe déjà dans la table suppliers';
|
||||
END IF;
|
||||
|
||||
-- Vérifier si la colonne automatic_reconciliation existe déjà
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'suppliers'
|
||||
AND column_name = 'automatic_reconciliation'
|
||||
AND table_schema = 'public'
|
||||
) THEN
|
||||
ALTER TABLE suppliers ADD COLUMN automatic_reconciliation BOOLEAN DEFAULT false;
|
||||
RAISE NOTICE 'Colonne automatic_reconciliation ajoutée à la table suppliers';
|
||||
ELSE
|
||||
RAISE NOTICE 'Colonne automatic_reconciliation existe déjà dans la table suppliers';
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
||||
-- Vérifier l'état final des colonnes
|
||||
SELECT
|
||||
column_name,
|
||||
data_type,
|
||||
is_nullable,
|
||||
column_default
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'suppliers'
|
||||
AND table_schema = 'public'
|
||||
ORDER BY ordinal_position;
|
||||
|
||||
COMMIT;
|
||||
Reference in new issue
Block a user