Fix builds migration
This commit is contained in:
parent
605ee2f7c5
commit
c7929572f3
|
@ -190,16 +190,23 @@ class V19 extends Migration
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'builds':
|
case 'builds':
|
||||||
try {
|
$attributesToCreate = [
|
||||||
$this->createAttributeFromCollection($this->projectDB, $id, 'deploymentInternalId');
|
'size',
|
||||||
} catch (\Throwable $th) {
|
'deploymentInternalId',
|
||||||
Console::warning("'deploymentInternalId' from {$id}: {$th->getMessage()}");
|
'logs',
|
||||||
|
];
|
||||||
|
foreach ($attributesToCreate as $attribute) {
|
||||||
|
try {
|
||||||
|
$this->createAttributeFromCollection($this->projectDB, $id, $attribute);
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
Console::warning("$attribute from {$id}: {$th->getMessage()}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->createAttributeFromCollection($this->projectDB, $id, 'logs');
|
$this->projectDB->renameAttribute($id, 'outputPath', 'path');
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Console::warning("'logs' from {$id}: {$th->getMessage()}");
|
Console::warning("'path' from {$id}: {$th->getMessage()}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->projectDB->deleteCachedCollection($id);
|
$this->projectDB->deleteCachedCollection($id);
|
||||||
|
@ -209,13 +216,13 @@ class V19 extends Migration
|
||||||
try {
|
try {
|
||||||
$this->projectDB->renameAttribute($id, 'log', 'logs');
|
$this->projectDB->renameAttribute($id, 'log', 'logs');
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Console::warning("'errors' from {$id}: {$th->getMessage()}");
|
Console::warning("'logs' from {$id}: {$th->getMessage()}");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->projectDB->updateAttribute($id, 'logs', size: 1000000);
|
$this->projectDB->updateAttribute($id, 'logs', size: 1000000);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Console::warning("'errors' from {$id}: {$th->getMessage()}");
|
Console::warning("'logs' from {$id}: {$th->getMessage()}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->projectDB->deleteCachedCollection($id);
|
$this->projectDB->deleteCachedCollection($id);
|
||||||
|
|
Loading…
Reference in a new issue