Files
nuqloud-ai/lib/Migration/Version020510Date20251112010000.php
T
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

97 lines
2.7 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;
class Version020510Date20251112010000 extends SimpleMigrationStep {
/**
* @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): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if (!$schema->hasTable('educai_tools')) {
$table = $schema->createTable('educai_tools');
$table->addColumn('id', Types::INTEGER, [
'unsigned' => true,
'notnull' => true,
'autoincrement' => true,
]);
$table->addColumn('name', Types::STRING, [
'length' => 190,
'notnull' => true,
]);
$table->addColumn('description', Types::TEXT, [
'notnull' => false,
]);
$table->addColumn('mcp_endpoint_url', Types::STRING, [
'length' => 255,
'notnull' => true,
]);
$table->addColumn('authentication', Types::TEXT, [
'notnull' => false,
]);
$table->addColumn('capabilities', Types::TEXT, [
'notnull' => false,
]);
$table->addColumn('enabled', Types::BOOLEAN, [
// Booleans must be nullable for Nextcloud's cross-db constraints (Oracle)
'notnull' => false,
// Store default as integer to avoid platform issues interpreting "false" as string
'default' => 0,
]);
$table->addColumn('created_at', Types::INTEGER, [
'notnull' => true,
]);
$table->addColumn('updated_at', Types::INTEGER, [
'notnull' => true,
]);
$table->setPrimaryKey(['id']);
$table->addIndex(['enabled'], 'educai_tools_enabled_idx');
}
if (!$schema->hasTable('educai_bot_tools')) {
$table = $schema->createTable('educai_bot_tools');
$table->addColumn('id', Types::INTEGER, [
'unsigned' => true,
'notnull' => true,
'autoincrement' => true,
]);
$table->addColumn('bot_id', Types::INTEGER, [
'unsigned' => true,
'notnull' => true,
]);
$table->addColumn('tool_id', Types::INTEGER, [
'unsigned' => true,
'notnull' => true,
]);
$table->addColumn('config_override', Types::TEXT, [
'notnull' => false,
]);
$table->addColumn('created_at', Types::INTEGER, [
'notnull' => true,
]);
$table->addColumn('updated_at', Types::INTEGER, [
'notnull' => true,
]);
$table->setPrimaryKey(['id']);
$table->addUniqueIndex(['bot_id', 'tool_id'], 'educai_bot_tools_bot_tool_uidx');
$table->addIndex(['tool_id'], 'educai_bot_tools_tool_idx');
}
return $schema;
}
}