Skip to content
Snippets Groups Projects
Commit 81c5a30f authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #14871 TIME 0:05 Improve action migration for 20.03

parent a1f16be7
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment