Files
nc-talk-ai/lib/Migration/Version023701Date20260504010000.php
Pascal Kienast 0739d3da6a Initial open-source release of Talk AI
Talk AI is a multi-bot AI assistant manager for Nextcloud Talk:
per-bot prompts and models, agentic tool calling (MCP + built-in
tools), RAG over Nextcloud files, room-document search, vision and
speech-to-text attachments, persistent bot wikis, approval workflows,
rate limiting, and multi-provider LLM support (any OpenAI-compatible
endpoint).

Developed within EDUC - the European Digital UniverCity
(https://educalliance.eu), where it runs as the 'EDUC AI' assistant on
the alliance-wide Nextcloud portal. This public repository is the
upstream point of truth; deployment-specific tools plug in via the
tool-provider extension point (docs/TOOL_PROVIDERS.md).

License: AGPL-3.0-or-later.
2026-07-08 21:13:13 +02:00

115 lines
3.0 KiB
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;
/**
* Add a persistent root registry for scalable wiki index event handling.
*/
class Version023701Date20260504010000 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array<string,mixed> $options
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if (!$schema->hasTable('educai_wiki_roots')) {
$table = $schema->createTable('educai_wiki_roots');
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('root_node_id', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('root_path', Types::STRING, [
'notnull' => true,
'length' => 1024,
]);
$table->addColumn('location', Types::STRING, [
'notnull' => true,
'length' => 32,
'default' => 'personal_files',
]);
$table->addColumn('collective_id', Types::BIGINT, [
'notnull' => false,
'unsigned' => true,
]);
$table->addColumn('active', Types::BOOLEAN, [
'notnull' => true,
'default' => true,
]);
$table->addColumn('last_synced_at', Types::BIGINT, [
'notnull' => false,
'unsigned' => true,
]);
$table->addColumn('last_error', Types::TEXT, [
'notnull' => false,
]);
$table->addColumn('created_at', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('updated_at', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->setPrimaryKey(['id']);
$table->addUniqueIndex(['root_node_id'], 'educai_wiki_root_node_u');
$table->addIndex(['active'], 'educai_wiki_root_active_i');
}
if (!$schema->hasTable('educai_wiki_root_bots')) {
$table = $schema->createTable('educai_wiki_root_bots');
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('root_id', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('bot_id', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('config_hash', Types::STRING, [
'notnull' => true,
'length' => 64,
]);
$table->addColumn('active', Types::BOOLEAN, [
'notnull' => true,
'default' => true,
]);
$table->addColumn('created_at', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('updated_at', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->setPrimaryKey(['id']);
$table->addUniqueIndex(['bot_id'], 'educai_wiki_root_bot_u');
$table->addIndex(['root_id'], 'educai_wiki_root_bot_root_i');
}
return $schema;
}
}