33 lines
852 B
PHP
33 lines
852 B
PHP
<?php
|
|
|
|
namespace OCA\GroupfolderFilesystemSnapshots\Migration;
|
|
|
|
use Closure;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\DB\Types;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
use OCP\Migration\IOutput;
|
|
|
|
class Version140Date20250701164500 extends SimpleMigrationStep {
|
|
const RESULTS_TABLE = "groupfolder_snapshots_task_results";
|
|
|
|
/**
|
|
* @param IOutput $output
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
* @param array $options
|
|
* @return null|ISchemaWrapper
|
|
*/
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
$table = $schema->getTable(self::RESULTS_TABLE);
|
|
|
|
if(!$table->hasColumn('current_file_id')) {
|
|
$table->addColumn('current_file_id', Types::BIGINT, [
|
|
'notnull' => false,
|
|
]);
|
|
}
|
|
|
|
return $schema;
|
|
}
|
|
}
|