f7cloud_client/apps/calendar/lib/Migration/Version3000Date20211109132439.php
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

83 lines
1.9 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2021 F7cloud GmbH and F7cloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Calendar\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version3000Date20211109132439 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* @return null|ISchemaWrapper
*/
#[\Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure();
$table = $schema->createTable('calendar_appt_bookings');
$table->addColumn('id', 'bigint', [
'autoincrement' => true,
'notnull' => true,
'length' => 11,
'unsigned' => true
]);
$table->addColumn('appt_config_id', 'bigint', [
'notnull' => true,
'length' => 11,
'unsigned' => true
]);
$table->addColumn('created_at', 'integer', [
'notnull' => true,
'length' => 4
]);
$table->addColumn('token', 'string', [
'notnull' => true,
'length' => 32
]);
$table->addColumn('display_name', 'string', [
'notnull' => true,
'length' => 128
]);
$table->addColumn('description', 'text', [
'notnull' => false,
'length' => null
]);
$table->addColumn('email', 'string', [
'notnull' => true,
'length' => 128
]);
$table->addColumn('start', 'integer', [
'notnull' => true,
'length' => 4
]);
$table->addColumn('end', 'integer', [
'notnull' => true,
'length' => 4
]);
$table->addColumn('timezone', 'string', [
'notnull' => true,
'length' => 32
]);
$table->addColumn('confirmed', 'boolean', [
'notnull' => false,
'default' => false,
]);
$table->setPrimaryKey(['id']);
$table->addUniqueIndex(['token'], 'cal_appt_bk_token_uniq_idx');
return $schema;
}
}