Skip to content
Snippets Groups Projects
Commit 9380e8b6 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Possibilité de mettre à jour la BDD sans traiter les données ni lancer les migrations

parent 74fc46ca
No related branches found
No related tags found
No related merge requests found
Pipeline #32095 passed
...@@ -850,19 +850,20 @@ class Bdd ...@@ -850,19 +850,20 @@ class Bdd
public function update(): self public function update(bool $withData = true, bool $withMigration=true): self
{ {
$this->logTitle('Mise à jour de la base de données'); $this->logTitle('Mise à jour de la base de données');
$ddl = $this->getRefDdl(); $ddl = $this->getRefDdl();
$filters = $this->getFiltersForUpdateBdd($ddl); $filters = $this->getFiltersForUpdateBdd($ddl);
if ($withMigration) {
// Initialisation et lancement de la pré-migration // Initialisation et lancement de la pré-migration
$migrationManager = $this->migration(); $migrationManager = $this->migration();
$migrationManager->init($ddl, $filters); $migrationManager->init($ddl, $filters);
$migrationManager->run(MigrationManager::ACTION_BEFORE); $migrationManager->run(MigrationManager::ACTION_BEFORE);
}
try { try {
$this->alter($ddl, $filters, true); $this->alter($ddl, $filters, true);
...@@ -880,11 +881,15 @@ class Bdd ...@@ -880,11 +881,15 @@ class Bdd
// Mise à jour des données // Mise à jour des données
if ($withData) {
$this->updateData(); $this->updateData();
}
if ($withMigration) {
// Post-migration // Post-migration
$migrationManager->run(MigrationManager::ACTION_AFTER); $migrationManager->run(MigrationManager::ACTION_AFTER);
}
return $this; return $this;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment