Ajout des fonctions de migration dans les taches Cron. Ajout du champ 'TB_Generations_bateaux.Version_soft' afin de mémoriser quelle est la structure en cours de la BDD active du bateau. Cette version est mise à jour à chaque détection (automatique) d'update, juste après la migration de la structure de la base du bateau sur le VPS
This commit is contained in:
+11
-1
@@ -195,7 +195,7 @@ function Executer_cron_quarantaine()
|
||||
continue;
|
||||
}
|
||||
$motif = ($origine_bdd === 'factory' || $origine_bdd === 'restauration') ? $origine_bdd : 'creation_initiale';
|
||||
$resultat_generation = Creer_generation($db, $id_bateau, $motif, $zone_usine);
|
||||
$resultat_generation = Creer_generation($db, $id_bateau, $motif, $zone_usine, $version_cible);
|
||||
if (!$resultat_generation['ok'])
|
||||
{
|
||||
echo " - {$nom} : échec de création de génération : " . $resultat_generation['raison'] . " - rejetée.\n";
|
||||
@@ -209,6 +209,16 @@ function Executer_cron_quarantaine()
|
||||
else
|
||||
{
|
||||
$nom_base_cible = $generation_active['nom_base'];
|
||||
// Même migration préalable que cron_archivage.php (synthèse §46) :
|
||||
$migration = Migrer_generation($db, $generation_active, $version_cible, $fichier_sql, $contenu_fichier_sql);
|
||||
if (!$migration['ok'])
|
||||
{
|
||||
echo " - {$nom} : " . $migration['raison'] . " - rejetée.\n";
|
||||
Trancher_archive_en_attente($db, $nom, $id_bateau, null, 'rejetee', $migration['raison'], $mmsi_recu, $mmsi_attendu_connu);
|
||||
if (!is_dir(REPERTOIRE_ERREURS)) @mkdir(REPERTOIRE_ERREURS, 0750, true);
|
||||
rename($chemin, REPERTOIRE_ERREURS . "/" . $nom);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$chargement = Charger_contenu_archive($nom_base_cible, $dechiffrement['sql']);
|
||||
|
||||
Reference in New Issue
Block a user