1
0
Fork 0
mirror of synced 2024-10-03 10:46:27 +13:00

Add Webhooks and schedules DB migrations

This commit is contained in:
Bradley Schofield 2024-01-22 11:18:43 +00:00
parent d599971c93
commit 5faf7899f8
7 changed files with 25 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -73,6 +73,22 @@ class V20 extends Migration
} catch (\Throwable $th) {
Console::warning("'oAuthProviders' from {$id}: {$th->getMessage()}");
}
case 'schedules':
try {
$this->createAttributeFromCollection($this->projectDB, $id, 'resourceCollection');
$this->projectDB->deleteCachedCollection($id);
} catch (\Throwable $th) {
Console::warning("'schedules' from {$id}: {$th->getMessage()}");
}
case 'webhooks':
try {
$this->createAttributeFromCollection($this->projectDB, $id, 'enabled');
$this->createAttributeFromCollection($this->projectDB, $id, 'logs');
$this->createAttributeFromCollection($this->projectDB, $id, 'attempts');
$this->projectDB->deleteCachedCollection($id);
} catch (\Throwable $th) {
Console::warning("'webhooks' from {$id}: {$th->getMessage()}");
}
default:
break;
}
@ -95,12 +111,9 @@ class V20 extends Migration
* Bump version number.
*/
$document->setAttribute('version', '1.5.0');
/**
* Rename providers to oAuthProviders
*/
$document->setAttribute('oAuthProviders', $document->getAttribute('providers'));
$document->removeAttribute('providers');
break;
case 'schedules':
$document->setAttribute('resourceCollection', 'functions');
break;
}
return $document;