Bug #16421
accélérer les migrations quand y'en a pas
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Catégorie:
-
Version cible:
-
Début:
20 mai 2017
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Description
En executant un migrate_schema manuel, je me suis rendu compte que ça ramait beaaaaucoup après le "No migrations to apply"
En en lisant le code de django :
if self.verbosity >= 1: self.stdout.write(" No migrations to apply.") # If there's changes that aren't in migrations yet, tell them how to fix it. autodetector = MigrationAutodetector( executor.loader.project_state(), ProjectState.from_apps(apps), ) changes = autodetector.changes(graph=executor.loader.graph) if changes: self.stdout.write(self.style.NOTICE( " Your models have changes that are not yet reflected " "in a migration, and so won't be applied." )) self.stdout.write(self.style.NOTICE( " Run 'manage.py makemigrations' to make new " "migrations, and then re-run 'manage.py migrate' to " "apply them." ))
Donc en verbosity 0, quand y'a pas de migration à faire, l'autodetect n'est pas lancé : migrer passerelle en dev ne prend pas plus de 4 secondes, contre 1m45 en verbosity 1.
Je propose donc de poser la verbosity à 0 par défaut pour migrate_schema (et ça sera celle dans les systèmes de démarrage de nos projet django hobotisés, ainsi accelérés)
Fichiers
Révisions associées
Historique
Mis à jour par Thomas Noël il y a presque 7 ans
- Fichier 0001-multitenant-set-default-verbosity-to-0-on-migrate_sc.patch 0001-multitenant-set-default-verbosity-to-0-on-migrate_sc.patch ajouté
- Statut changé de Nouveau à En cours
- Patch proposed changé de Non à Oui
Mis à jour par Thomas Noël il y a presque 7 ans
- Statut changé de En cours à Résolu (à déployer)
commit 255133263525433215e2ef2643ec908a23f63444 Author: Thomas NOEL <tnoel@entrouvert.com> Date: Sat May 20 23:44:21 2017 +0200 multitenant: set default verbosity to 0 on migrate_schemas (#16421) with verbosity=0, Django migrate_schema don't use autodetector, this speeds up the process.
Mis à jour par Thomas Noël il y a presque 7 ans
faudrait peut-être à la place logguer quelque chose, "journalctl -fu combo" ne dit plus rien du tout quand y'a des migrations en cours, c'est pas top
Mis à jour par Frédéric Péters il y a plus de 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
multitenant: set default verbosity to 0 on migrate_schemas (#16421)
with verbosity=0, Django migrate_schema don't use autodetector,
this speeds up the process.