forked from NuQloud/nc-talk-ai
35 lines
798 B
PHP
35 lines
798 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\EducAI\Migration;
|
|
|
|
use Closure;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\DB\Types;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
class Version024002Date20260904000000 extends SimpleMigrationStep {
|
|
/**
|
|
* @param Closure(): ISchemaWrapper $schemaClosure
|
|
* @param array<string,mixed> $options
|
|
*/
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
$schema = $schemaClosure();
|
|
if (!$schema->hasTable('educai_queue')) {
|
|
return $schema;
|
|
}
|
|
|
|
$table = $schema->getTable('educai_queue');
|
|
if (!$table->hasColumn('talk_message_id')) {
|
|
$table->addColumn('talk_message_id', Types::BIGINT, [
|
|
'notnull' => false,
|
|
'unsigned' => true,
|
|
]);
|
|
}
|
|
|
|
return $schema;
|
|
}
|
|
}
|