Add teams migration

This commit is contained in:
Jake Barnby 2023-04-12 00:33:29 +12:00
parent b0a6190394
commit 43946cade5
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -58,7 +58,7 @@ class V18 extends Migration
if ($attribute['type'] !== Database::VAR_FLOAT) {
continue;
}
$this->changeAttributeInternalType($collectionTable, $attribute['$id'], 'DOUBLE');
$this->changeAttributeInternalType($collectionTable, $attribute['key'], 'DOUBLE');
}
}
}
@ -95,6 +95,17 @@ class V18 extends Migration
Console::warning("'passwordHistory' from {$id}: {$th->getMessage()}");
}
break;
case 'teams':
try {
/**
* Create 'prefs' attribute
*/
$this->createAttributeFromCollection($this->projectDB, $id, 'prefs');
$this->projectDB->deleteCachedCollection($id);
} catch (\Throwable $th) {
Console::warning("'prefs' from {$id}: {$th->getMessage()}");
}
break;
default:
break;
}
@ -132,6 +143,12 @@ class V18 extends Migration
*/
$document->setAttribute('passwordHistory', []);
break;
case 'teams':
/**
* Default prefs
*/
$document->setAttribute('prefs', new \stdClass());
break;
}
return $document;