for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace OCA\FaceRecognition\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use OCP\IDBConnection;
class Version0910Date20221109096049 extends SimpleMigrationStep {
private $connection;
public function __construct(IDBConnection $connection) {
$this->connection = $connection;
}
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
*/
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
* @return null|ISchemaWrapper
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure();
$table = $schema->getTable('facerecog_faces');
if ($table->hasColumn('width') && $table->hasColumn('left')) {
$table->dropColumn('left');
$table->dropColumn('top');
$table->dropColumn('right');
$table->dropColumn('bottom');
return $schema;
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {