diff --git a/migration/20.03/2003.sql b/migration/20.03/2003.sql index d15bb67ac9eb4bf7fb51eb5c824821134d0ffda0..e066643b979c18387915a252ec0235b96e6576d8 100755 --- a/migration/20.03/2003.sql +++ b/migration/20.03/2003.sql @@ -5,10 +5,19 @@ -- -- -- -- -- *************************************************************************-- -UPDATE parameters SET param_value_string = '20.03' WHERE id = 'database_version'; +UPDATE parameters SET param_value_string = '20.03.11' WHERE id = 'database_version'; UPDATE parameters SET description = 'Département par défaut sélectionné dans les autocomplétions de la Base Adresse Nationale' WHERE id = 'defaultDepartment'; +/*CLEAN DATA*/ +/*Exists in groupbasket_status but not in actions_groupbaskets*/ +DELETE FROM groupbasket_status WHERE system_id IN ( + select system_id from groupbasket_status gbs + where not exists ( + select 1 from actions_groupbaskets agb where gbs.action_id = agb.id_action and gbs.group_id = agb.group_id and gbs.basket_id = agb.basket_id + ) +) + /* VIEWS */ DROP VIEW IF EXISTS res_view_letterbox; DROP VIEW IF EXISTS res_view_attachments; diff --git a/migration/20.03/migrateIndexing.php b/migration/20.03/migrateIndexing.php index f85b11609a3edfcd7c02e141518e38865397b89b..b7b862ad148496c88d7fe4fd3dc081359a89f7e7 100644 --- a/migration/20.03/migrateIndexing.php +++ b/migration/20.03/migrateIndexing.php @@ -158,7 +158,7 @@ foreach ($customs as $custom) { $migrated = 0; $actionsToDelete = []; foreach ($basketsWithStatuses as $value) { - if (!in_array($value['action_id'], $actionsToDelete)) { + if (!in_array($value['action_id'], $actionsToDelete) && !in_array($value['action_id'], $actions)) { $actionsToDelete[] = $value['action_id']; } @@ -227,5 +227,12 @@ foreach ($customs as $custom) { 'data' => ['indexing'] ]); + \SrcCore\models\DatabaseModel::update([ + 'set' => ['action_page' => '', 'component' => 'confirmAction'], + 'table' => 'actions', + 'where' => ['action_page = ?'], + 'data' => ['index_mlb'] + ]); + printf("Migration Indexing Basket (CUSTOM {$custom}) : " . $migrated . " action(s) avec des status (mot clé indexation) trouvé(s) et migré(s).\n"); }