diff --git a/lib/Migration/Version010000001Date20250727094721.php b/lib/Migration/Version010000001Date20250727094721.php index 5a264ecaa..166b0b34b 100644 --- a/lib/Migration/Version010000001Date20250727094721.php +++ b/lib/Migration/Version010000001Date20250727094721.php @@ -38,7 +38,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->getTable('recognize_face_detections'); if (!$table->hasColumn('face_vector')) { $table->addColumn('face_vector', Types::TEXT, [ - 'notnull' => true, + 'notnull' => false, ]); return $schema; } diff --git a/lib/Migration/Version010000001Date20250727094821.php b/lib/Migration/Version010000001Date20250727094821.php index 591dfdd9b..326979cfc 100644 --- a/lib/Migration/Version010000001Date20250727094821.php +++ b/lib/Migration/Version010000001Date20250727094821.php @@ -27,13 +27,20 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); + $changed = false; if ($schema->hasTable('recognize_face_detections')) { $table = $schema->getTable('recognize_face_detections'); if ($table->hasColumn('vector')) { $table->dropColumn('vector'); - return $schema; + $changed = true; + } + if ($table->hasColumn('face_vector')) { + $table->modifyColumn('face_vector', [ + 'notnull' => true, + ]); + $changed = true; } } - return null; + return $changed ? $schema : null; } }