mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
migration can not be empty
This commit is contained in:
parent
89c988d73c
commit
6756ee31b6
1 changed files with 7 additions and 16 deletions
|
|
@ -395,24 +395,15 @@ class Migrations extends Action
|
||||||
Console::error('Line: ' . $th->getLine());
|
Console::error('Line: ' . $th->getLine());
|
||||||
Console::error($th->getTraceAsString());
|
Console::error($th->getTraceAsString());
|
||||||
|
|
||||||
if (! $migration->isEmpty()) {
|
$migration->setAttribute('status', 'failed');
|
||||||
$migration->setAttribute('status', 'failed');
|
$migration->setAttribute('stage', 'finished');
|
||||||
$migration->setAttribute('stage', 'finished');
|
|
||||||
|
|
||||||
call_user_func($this->logError, $th, 'appwrite-worker', 'appwrite-queue-'.self::getName(), [
|
call_user_func($this->logError, $th, 'appwrite-worker', 'appwrite-queue-'.self::getName(), [
|
||||||
'migrationId' => $migration->getId(),
|
'migrationId' => $migration->getId(),
|
||||||
'source' => $migration->getAttribute('source') ?? '',
|
'source' => $migration->getAttribute('source') ?? '',
|
||||||
'destination' => $migration->getAttribute('destination') ?? '',
|
'destination' => $migration->getAttribute('destination') ?? '',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($transfer) {
|
|
||||||
$sourceErrors = $source->getErrors();
|
|
||||||
$destinationErrors = $destination->getErrors();
|
|
||||||
$migration->setAttribute('errors', $this->sanitizeErrors($sourceErrors, $destinationErrors));
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
$this->updateMigrationDocument($migration, $project, $queueForRealtime);
|
$this->updateMigrationDocument($migration, $project, $queueForRealtime);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue