Fix V24 schema migration gaps

This commit is contained in:
Chirag Aggarwal committed 2026-06-27 08:19:12 +05:30
1 parent dbd45b50b7
commit 0477282e21
1 file changed
+41
+41
View File
@@ -115,6 +115,12 @@ class V24 extends Migration
} catch (Throwable $th) {
Console::warning('Failed to create attributes "' . \implode(', ', $attributes) . "\" in collection {$id}: {$th->getMessage()}");
}
try {
$this->createIndexFromCollection($this->dbForProject, $id, '_key_teamInternalId');
} catch (Throwable $th) {
Console::warning("Failed to create index \"_key_teamInternalId\" from {$id}: {$th->getMessage()}");
}
}
$this->dbForProject->purgeCachedCollection($id);
break;
@@ -213,6 +219,15 @@ class V24 extends Migration
$this->dbForProject->purgeCachedCollection($id);
break;
case 'memberships':
try {
$this->createIndexFromCollection($this->dbForProject, $id, '_key_team_confirm');
} catch (Throwable $th) {
Console::warning("Failed to create index \"_key_team_confirm\" from {$id}: {$th->getMessage()}");
}
$this->dbForProject->purgeCachedCollection($id);
break;
case 'tokens':
try {
$this->createIndexFromCollection($this->dbForProject, $id, '_key_type_expire');
@@ -299,6 +314,32 @@ class V24 extends Migration
$this->dbForProject->purgeCachedCollection($id);
break;
case 'platforms':
case 'webhooks':
if ($collectionType === 'console') {
try {
$this->createIndexFromCollection($this->dbForProject, $id, '_key_project_id');
} catch (Throwable $th) {
Console::warning("Failed to create index \"_key_project_id\" from {$id}: {$th->getMessage()}");
}
}
$this->dbForProject->purgeCachedCollection($id);
break;
case 'reports':
case 'insights':
if ($collectionType === 'console') {
try {
$this->createCollection($id);
} catch (Throwable $th) {
Console::warning("Failed to create collection \"{$id}\": {$th->getMessage()}");
throw $th;
}
}
$this->dbForProject->purgeCachedCollection($id);
break;
case 'providers':
try {
$this->dbForProject->deleteIndex($id, '_key_name');