0
0
mirror of https://github.com/nextcloud/server.git synced 2024-12-28 07:58:42 +00:00
nextcloud_server/core/Migrations/Version25000Date20220515204012.php
Andy Scherzinger 5c49a54801
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-26 20:05:04 +02:00

38 lines
799 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2019 ownCloud GmbH
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Core\Migrations;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version25000Date20220515204012 extends SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if ($schema->hasTable('share')) {
$shareTable = $schema->getTable('share');
if (!$shareTable->hasColumn('attributes')) {
$shareTable->addColumn(
'attributes',
Types::JSON,
[
'default' => null,
'notnull' => false
]
);
}
}
return $schema;
}
}