Skip to content
Snippets Groups Projects
Commit a3c92f45 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #12091 TIME 4:00 fixed migration errors

parent 82a11b32
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,8 @@ DROP VIEW IF EXISTS view_contacts; ...@@ -12,6 +12,8 @@ DROP VIEW IF EXISTS view_contacts;
DROP TABLE IF EXISTS cases; DROP TABLE IF EXISTS cases;
DROP TABLE IF EXISTS cases_res; DROP TABLE IF EXISTS cases_res;
DELETE FROM contacts_groups_lists WHERE contact_id IS NULL;
DROP TABLE IF EXISTS contacts_res; DROP TABLE IF EXISTS contacts_res;
DROP TABLE IF EXISTS contact_addresses; DROP TABLE IF EXISTS contact_addresses;
DROP TABLE IF EXISTS contact_communication; DROP TABLE IF EXISTS contact_communication;
......
...@@ -363,6 +363,12 @@ DO $$ BEGIN ...@@ -363,6 +363,12 @@ DO $$ BEGIN
UPDATE security SET where_clause = REGEXP_REPLACE(where_clause, 'typist(\s*)=(\s*)@user', 'typist = @user_id', 'gmi'); UPDATE security SET where_clause = REGEXP_REPLACE(where_clause, 'typist(\s*)=(\s*)@user', 'typist = @user_id', 'gmi');
END IF; END IF;
END$$; END$$;
ALTER TABLE res_letterbox ADD COLUMN IF NOT EXISTS scan_date timestamp without time zone;
ALTER TABLE res_letterbox ADD COLUMN IF NOT EXISTS scan_user CHARACTER VARYING (50) DEFAULT NULL::character varying;
ALTER TABLE res_letterbox ADD COLUMN IF NOT EXISTS scan_location CHARACTER VARYING (255) DEFAULT NULL::character varying;
ALTER TABLE res_letterbox ADD COLUMN IF NOT EXISTS scan_wkstation CHARACTER VARYING (255) DEFAULT NULL::character varying;
ALTER TABLE res_letterbox ADD COLUMN IF NOT EXISTS scan_batch CHARACTER VARYING (50) DEFAULT NULL::character varying;
ALTER TABLE res_letterbox ADD COLUMN IF NOT EXISTS scan_postmark CHARACTER VARYING (50) DEFAULT NULL::character varying;
/* USERGROUP_CONTENT */ /* USERGROUP_CONTENT */
......
...@@ -20,4 +20,5 @@ php ./migrateM2MConfiguration.php ...@@ -20,4 +20,5 @@ php ./migrateM2MConfiguration.php
php ./removeNatureFromPrint.php php ./removeNatureFromPrint.php
php ./migrateCustomValues.php php ./migrateCustomValues.php
php ./migrateVersionAttachments.php php ./migrateVersionAttachments.php
php ./migrateContacts.php php ./migrateContacts.php
\ No newline at end of file php ./migrateTemplates.php
...@@ -13,6 +13,9 @@ foreach ($customs as $custom) { ...@@ -13,6 +13,9 @@ foreach ($customs as $custom) {
continue; continue;
} }
\SrcCore\models\DatabasePDO::reset();
new \SrcCore\models\DatabasePDO(['customId' => $custom]);
$path = "custom/{$custom}/apps/maarch_entreprise/xml/config.xml"; $path = "custom/{$custom}/apps/maarch_entreprise/xml/config.xml";
if (file_exists($path)) { if (file_exists($path)) {
if (!is_readable($path) || !is_writable($path)) { if (!is_readable($path) || !is_writable($path)) {
......
...@@ -71,7 +71,7 @@ foreach ($customs as $custom) { ...@@ -71,7 +71,7 @@ foreach ($customs as $custom) {
$fingerprint = \Resource\controllers\StoreController::getFingerPrint(['filePath' => $pathToDocument, 'mode' => $docserverType[0]['fingerprint_mode']]); $fingerprint = \Resource\controllers\StoreController::getFingerPrint(['filePath' => $pathToDocument, 'mode' => $docserverType[0]['fingerprint_mode']]);
$attachmentInfo['fingerprint'] = $fingerprint; $attachmentInfo['fingerprint'] = $fingerprint;
} else { } else {
$attachmentInfo['fingerprint'] = 1; $attachmentInfo['fingerprint'] = '1';
} }
} }
...@@ -80,7 +80,7 @@ foreach ($customs as $custom) { ...@@ -80,7 +80,7 @@ foreach ($customs as $custom) {
if ($attachmentInfo['fingerprint'] == 1) { if ($attachmentInfo['fingerprint'] == 1) {
echo "Le document avec res_version_attachments.res_id = " . $oldResId echo "Le document avec res_version_attachments.res_id = " . $oldResId
. " (nouveau res_id : res_attachment.res_id = " . $newResId . ") n'a pas été trouvé sur le docserver (path = '" . $pathToDocument . "')" . " (nouveau res_id : res_attachment.res_id = " . $newResId . ") n'a pas été trouvé sur le docserver (path = '" . $pathToDocument . "')"
. ", le fingerprint du document est assigné à 1"; . ", le fingerprint du document est assigné à 1\n";
} }
migrateOrigin(['oldResId' => $oldResId, 'newResId' => $newResId]); migrateOrigin(['oldResId' => $oldResId, 'newResId' => $newResId]);
......
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