1
0
Fork 0
mirror of synced 2024-07-02 13:10:38 +12:00

Fix builds migration

This commit is contained in:
Steven Nguyen 2023-09-02 22:45:37 -07:00
parent 605ee2f7c5
commit c7929572f3
No known key found for this signature in database

View file

@ -190,16 +190,23 @@ class V19 extends Migration
break;
case 'builds':
try {
$this->createAttributeFromCollection($this->projectDB, $id, 'deploymentInternalId');
} catch (\Throwable $th) {
Console::warning("'deploymentInternalId' from {$id}: {$th->getMessage()}");
$attributesToCreate = [
'size',
'deploymentInternalId',
'logs',
];
foreach ($attributesToCreate as $attribute) {
try {
$this->createAttributeFromCollection($this->projectDB, $id, $attribute);
} catch (\Throwable $th) {
Console::warning("$attribute from {$id}: {$th->getMessage()}");
}
}
try {
$this->createAttributeFromCollection($this->projectDB, $id, 'logs');
$this->projectDB->renameAttribute($id, 'outputPath', 'path');
} catch (\Throwable $th) {
Console::warning("'logs' from {$id}: {$th->getMessage()}");
Console::warning("'path' from {$id}: {$th->getMessage()}");
}
$this->projectDB->deleteCachedCollection($id);
@ -209,13 +216,13 @@ class V19 extends Migration
try {
$this->projectDB->renameAttribute($id, 'log', 'logs');
} catch (\Throwable $th) {
Console::warning("'errors' from {$id}: {$th->getMessage()}");
Console::warning("'logs' from {$id}: {$th->getMessage()}");
}
try {
$this->projectDB->updateAttribute($id, 'logs', size: 1000000);
} catch (\Throwable $th) {
Console::warning("'errors' from {$id}: {$th->getMessage()}");
Console::warning("'logs' from {$id}: {$th->getMessage()}");
}
$this->projectDB->deleteCachedCollection($id);