mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Apply database migration to add `stock_epuise`, `stock_epuise_by`, and `stock_epuise_at` columns to the `dlc_products` table. Includes a new urgent production fix script to apply the migration and restart the application. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f9197b9b-a5b3-4469-a27d-930a9e9ee736 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/f9197b9b-a5b3-4469-a27d-930a9e9ee736/i2gFnxm
1.5 KiB
1.5 KiB
SOLUTION URGENTE - Production DLC
Commande immédiate à exécuter sur votre serveur
Étape 1: Appliquer la migration
docker-compose exec logiflow-db psql -U logiflow_admin -d logiflow_db << 'EOF'
ALTER TABLE dlc_products
ADD COLUMN IF NOT EXISTS stock_epuise boolean DEFAULT false NOT NULL,
ADD COLUMN IF NOT EXISTS stock_epuise_by varchar(255),
ADD COLUMN IF NOT EXISTS stock_epuise_at timestamp;
CREATE INDEX IF NOT EXISTS idx_dlc_products_stock_epuise ON dlc_products(stock_epuise);
SELECT 'Migration DLC terminée' as status;
EOF
Étape 2: Redémarrer l'application
docker-compose restart logiflow
Si la première commande ne fonctionne pas
Alternative avec connexion directe:
# Identifier le nom du conteneur PostgreSQL
docker ps | grep postgres
# Se connecter directement
docker exec -it [NOM_CONTENEUR_POSTGRES] psql -U logiflow_admin -d logiflow_db
# Puis dans psql, exécuter:
ALTER TABLE dlc_products
ADD COLUMN IF NOT EXISTS stock_epuise boolean DEFAULT false NOT NULL,
ADD COLUMN IF NOT EXISTS stock_epuise_by varchar(255),
ADD COLUMN IF NOT EXISTS stock_epuise_at timestamp;
CREATE INDEX IF NOT EXISTS idx_dlc_products_stock_epuise ON dlc_products(stock_epuise);
\q
Vérification
Après l'application, vérifiez que les colonnes existent :
docker-compose exec logiflow-db psql -U logiflow_admin -d logiflow_db -c "\d dlc_products"
L'erreur "column does not exist" disparaîtra immédiatement.