#!/bin/bash # Script de migration SQLite β†’ PostgreSQL # Γ€ exΓ©cuter depuis le host oΓΉ Docker tourne echo "πŸ”„ Migration SQLite β†’ PostgreSQL" echo "================================" echo "" # VΓ©rifier que les containers tournent if ! docker ps | grep -q "noteflow-postgres"; then echo "❌ Container PostgreSQL non trouvΓ©. Lancez: docker-compose up -d" exit 1 fi if ! docker ps | grep -q "notes-todo-app"; then echo "❌ Container notes-todo-app non trouvΓ©. Lancez: docker-compose up -d" exit 1 fi echo "βœ… Containers trouvΓ©s" echo "" # Test de connexion PostgreSQL echo "πŸ” Test de connexion PostgreSQL..." docker exec notes-todo-app node scripts/verify-postgres-connection.js if [ $? -ne 0 ]; then echo "" echo "❌ Impossible de se connecter Γ  PostgreSQL" exit 1 fi echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "πŸ“Š Lancement de la migration..." echo "" # ExΓ©cuter la migration depuis le container notes-todo-app # Le fichier SQLite est montΓ© dans /app/data-sqlite/notes.db docker exec -e SQLITE_PATH=/app/data-sqlite/notes.db notes-todo-app node scripts/migrate-sqlite-to-postgres.js if [ $? -eq 0 ]; then echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "βœ… Migration terminΓ©e avec succΓ¨s!" echo "" echo "πŸ“‹ Prochaines Γ©tapes:" echo " 1. VΓ©rifier les articles RSS dans l'interface" echo " 2. Tester la rΓ©cupΓ©ration des flux RSS" echo " 3. Supprimer l'ancienne base SQLite (data/notes.db) si tout fonctionne" else echo "" echo "❌ Erreur lors de la migration" exit 1 fi