add internalId to collections
This commit is contained in:
parent
f96a9c3618
commit
586c7fac7c
3 changed files with 27 additions and 0 deletions
|
@ -2234,6 +2234,17 @@ $collections = [
|
||||||
'array' => false,
|
'array' => false,
|
||||||
'filters' => [],
|
'filters' => [],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'$id' => ID::custom('deploymentInternalId'),
|
||||||
|
'type' => Database::VAR_STRING,
|
||||||
|
'format' => '',
|
||||||
|
'size' => Database::LENGTH_KEY,
|
||||||
|
'signed' => true,
|
||||||
|
'required' => false,
|
||||||
|
'default' => null,
|
||||||
|
'array' => false,
|
||||||
|
'filters' => [],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'$id' => ID::custom('deployment'),
|
'$id' => ID::custom('deployment'),
|
||||||
'type' => Database::VAR_STRING,
|
'type' => Database::VAR_STRING,
|
||||||
|
@ -2267,6 +2278,17 @@ $collections = [
|
||||||
'array' => true,
|
'array' => true,
|
||||||
'filters' => [],
|
'filters' => [],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'$id' => ID::custom('scheduleInternalId'),
|
||||||
|
'type' => Database::VAR_STRING,
|
||||||
|
'format' => '',
|
||||||
|
'size' => Database::LENGTH_KEY,
|
||||||
|
'signed' => true,
|
||||||
|
'required' => false,
|
||||||
|
'default' => null,
|
||||||
|
'array' => false,
|
||||||
|
'filters' => [],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'$id' => ID::custom('scheduleId'),
|
'$id' => ID::custom('scheduleId'),
|
||||||
'type' => Database::VAR_STRING,
|
'type' => Database::VAR_STRING,
|
||||||
|
|
|
@ -81,6 +81,7 @@ App::post('/v1/functions')
|
||||||
'enabled' => $enabled,
|
'enabled' => $enabled,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'runtime' => $runtime,
|
'runtime' => $runtime,
|
||||||
|
'deploymentInternalId' => '',
|
||||||
'deployment' => '',
|
'deployment' => '',
|
||||||
'events' => $events,
|
'events' => $events,
|
||||||
'schedule' => $schedule,
|
'schedule' => $schedule,
|
||||||
|
@ -102,6 +103,7 @@ App::post('/v1/functions')
|
||||||
);
|
);
|
||||||
|
|
||||||
$function->setAttribute('scheduleId', $schedule->getId());
|
$function->setAttribute('scheduleId', $schedule->getId());
|
||||||
|
$function->setAttribute('scheduleInternalId', $schedule->getInternalId());
|
||||||
$dbForProject->updateDocument('functions', $function->getId(), $function);
|
$dbForProject->updateDocument('functions', $function->getId(), $function);
|
||||||
|
|
||||||
$eventsInstance->setParam('functionId', $function->getId());
|
$eventsInstance->setParam('functionId', $function->getId());
|
||||||
|
@ -534,6 +536,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
|
||||||
}
|
}
|
||||||
|
|
||||||
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
||||||
|
'deploymentInternalId' => $deployment->getInternalId(),
|
||||||
'deployment' => $deployment->getId()
|
'deployment' => $deployment->getId()
|
||||||
])));
|
])));
|
||||||
|
|
||||||
|
@ -969,6 +972,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
||||||
if ($function->getAttribute('deployment') === $deployment->getId()) { // Reset function deployment
|
if ($function->getAttribute('deployment') === $deployment->getId()) { // Reset function deployment
|
||||||
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
||||||
'deployment' => '',
|
'deployment' => '',
|
||||||
|
'deploymentInternalId' => '',
|
||||||
])));
|
])));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,6 +206,7 @@ class BuildsV1 extends Worker
|
||||||
|
|
||||||
/** Set auto deploy */
|
/** Set auto deploy */
|
||||||
if ($deployment->getAttribute('activate') === true) {
|
if ($deployment->getAttribute('activate') === true) {
|
||||||
|
$function->setAttribute('deploymentInternalId', $deployment->getInternalId());
|
||||||
$function->setAttribute('deployment', $deployment->getId());
|
$function->setAttribute('deployment', $deployment->getId());
|
||||||
$function = $dbForProject->updateDocument('functions', $function->getId(), $function);
|
$function = $dbForProject->updateDocument('functions', $function->getId(), $function);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue