import os
import shutil

APPS = [
    "Establishment",
    "Settings",
    "Subscriptions",
    "Planning",
    "GestionNotification",
    "GestionMessagerie",
    "GestionEmail",
    "Auth",
    "School",
    "Common"
]

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

for app in APPS:
    migrations_path = os.path.join(BASE_DIR, app, "migrations")
    if os.path.isdir(migrations_path):
        print(f"Suppression du dossier : {migrations_path}")
        shutil.rmtree(migrations_path)
    else:
        print(f"Aucun dossier de migration trouvé pour {app}")

print("Nettoyage terminé.")