feat: add migration commands for media cooperation and reports while removing obsolete cooperation migration.
This commit is contained in:
parent
4d1e956d39
commit
bce5776696
@ -256,8 +256,8 @@ private function migrateAllDocuments(Company $company, $legacy): void
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path mapping: old data/companies/ + path from db
|
// Path mapping: old-data/companies/ + path from db
|
||||||
$sourcePath = 'old data/companies/'.$legacyPath;
|
$sourcePath = 'old-data/companies/'.$legacyPath;
|
||||||
|
|
||||||
$this->importOneDocument($company, $sourcePath, $docTypeSuffix, $legacy);
|
$this->importOneDocument($company, $sourcePath, $docTypeSuffix, $legacy);
|
||||||
}
|
}
|
||||||
@ -316,8 +316,8 @@ private function migrateMediaDocuments(PartnerMedia $media, $legacyMedia): void
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path mapping: old data/media/ + path from db
|
// Path mapping: old-data/media/ + path from db
|
||||||
$sourcePath = 'old data/media/'.$legacyPath;
|
$sourcePath = 'old-data/media/'.$legacyPath;
|
||||||
|
|
||||||
$this->importOneMediaDocument($media, $sourcePath, $docType, $legacyMedia);
|
$this->importOneMediaDocument($media, $sourcePath, $docType, $legacyMedia);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -164,7 +164,7 @@ private function processRecap($legacy): void
|
|||||||
private function migrateMedia(ContentRecap $recap, $legacy): void
|
private function migrateMedia(ContentRecap $recap, $legacy): void
|
||||||
{
|
{
|
||||||
$filename = trim(basename($legacy->image));
|
$filename = trim(basename($legacy->image));
|
||||||
$sourcePath = 'old data/content-recaps/'.$filename;
|
$sourcePath = 'old-data/content-recaps/'.$filename;
|
||||||
|
|
||||||
$attempts = 0;
|
$attempts = 0;
|
||||||
$maxAttempts = 3;
|
$maxAttempts = 3;
|
||||||
|
|||||||
@ -136,8 +136,8 @@ private function migrateJournalistDocuments(Journalist $journalist, $legacy): vo
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path mapping: old data/companies/ + path from db (based on legacy structure)
|
// Path mapping: old-data/companies/ + path from db (based on legacy structure)
|
||||||
$sourcePath = 'old data/companies/'.$legacyPath;
|
$sourcePath = 'old-data/companies/'.$legacyPath;
|
||||||
|
|
||||||
$this->importOneDocument($journalist, $sourcePath, $docType, $legacy);
|
$this->importOneDocument($journalist, $sourcePath, $docType, $legacy);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -165,7 +165,7 @@ private function handleTheme($legacy): void
|
|||||||
private function migrateMedia(MediaMonitoring $monitoring, $legacy): void
|
private function migrateMedia(MediaMonitoring $monitoring, $legacy): void
|
||||||
{
|
{
|
||||||
$filename = trim(basename($legacy->image));
|
$filename = trim(basename($legacy->image));
|
||||||
$sourcePath = 'old data/mediamonitorings/'.$filename;
|
$sourcePath = 'old-data/mediamonitorings/'.$filename;
|
||||||
|
|
||||||
$exists = false;
|
$exists = false;
|
||||||
$attempts = 0;
|
$attempts = 0;
|
||||||
|
|||||||
@ -130,7 +130,7 @@ private function processNews($legacy): void
|
|||||||
private function migrateMedia(News $news, $legacy): void
|
private function migrateMedia(News $news, $legacy): void
|
||||||
{
|
{
|
||||||
$filename = trim(basename($legacy->image));
|
$filename = trim(basename($legacy->image));
|
||||||
$sourcePath = 'old data/news/'.$filename;
|
$sourcePath = 'old-data/news/'.$filename;
|
||||||
|
|
||||||
$exists = false;
|
$exists = false;
|
||||||
$attempts = 0;
|
$attempts = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user