mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-15 03:09:32 +02:00
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
26 lines
690 B
PL/PgSQL
26 lines
690 B
PL/PgSQL
-- CORRECTION URGENTE : Ajouter la colonne email manquante dans suppliers
|
|
-- Cette colonne est requise par le code Drizzle mais n'existe pas en production
|
|
|
|
BEGIN;
|
|
|
|
-- Ajouter la colonne email après phone
|
|
ALTER TABLE suppliers ADD COLUMN email character varying(255);
|
|
|
|
-- Mettre à jour la timestamp
|
|
UPDATE suppliers SET updated_at = CURRENT_TIMESTAMP;
|
|
|
|
-- Vérifier le résultat
|
|
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;
|
|
|
|
-- Message de confirmation
|
|
SELECT 'Colonne email ajoutée avec succès à la table suppliers' as status; |