mirror of
https://github.com/nextcloud/server.git
synced 2026-06-29 02:21:44 -04:00
38 lines
988 B
PHP
38 lines
988 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCA\DAV\Migration;
|
|
|
|
use Closure;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\DB\Types;
|
|
use OCP\Migration\Attributes\AddColumn;
|
|
use OCP\Migration\Attributes\ColumnType;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
#[AddColumn(table: 'calendars', name: 'default_alarm', type: ColumnType::STRING)]
|
|
class Version1038Date20260302000000 extends SimpleMigrationStep {
|
|
#[\Override]
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
|
|
$calendarsTable = $schema->getTable('calendars');
|
|
|
|
if (!$calendarsTable->hasColumn('default_alarm')) {
|
|
$calendarsTable->addColumn('default_alarm', Types::INTEGER, [
|
|
'notnull' => false,
|
|
'default' => null,
|
|
]);
|
|
}
|
|
|
|
return $schema;
|
|
}
|
|
}
|