%PDF- %PDF-
Direktori : /www/varak.net/nextcloud.varak.net/apps/app_api/lib/Migration/ |
Current File : //www/varak.net/nextcloud.varak.net/apps/app_api/lib/Migration/Version2700Date20240515092246.php |
<?php declare(strict_types=1); /** * @copyright Copyright (c) 2024 Kate Döen <kate.doeen@nextcloud.com> * * @author Kate Döen <kate.doeen@nextcloud.com> * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ namespace OCA\AppAPI\Migration; use Closure; use OCP\DB\ISchemaWrapper; use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; class Version2700Date20240515092246 extends SimpleMigrationStep { /** * @param IOutput $output * @param Closure(): ISchemaWrapper $schemaClosure * @param array $options * @return null|ISchemaWrapper */ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); if (!$schema->hasTable('ex_task_processing')) { $table = $schema->createTable('ex_task_processing'); $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, ]); $table->addColumn('app_id', Types::STRING, [ 'notnull' => true, 'length' => 32, ]); $table->addColumn('name', Types::STRING, [ 'notnull' => true, 'length' => 64, ]); $table->addColumn('display_name', Types::STRING, [ 'notnull' => true, 'length' => 64, ]); $table->addColumn('task_type', Types::STRING, [ 'notnull' => true, 'length' => 64, ]); $table->setPrimaryKey(['id']); $table->addUniqueIndex(['app_id', 'name', 'task_type'], 'task_processing_idx'); } return $schema; } }