Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/Migrations/Version33000Date20250819110529.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
if (!$schema->hasTable('preview_locations')) {
$table = $schema->createTable('preview_locations');
$table->addColumn('id', Types::BIGINT, ['autoincrement' => true, 'notnull' => true, 'length' => 20, 'unsigned' => true]);
$table->addColumn('bucket_name', Types::STRING, ['notnull' => true, 'length' => 40]);
$table->addColumn('bucket_name', Types::STRING, ['notnull' => true, 'length' => 63]);
$table->addColumn('object_store_name', Types::STRING, ['notnull' => true, 'length' => 40]);
$table->setPrimaryKey(['id']);
}
Expand Down
40 changes: 40 additions & 0 deletions core/Migrations/Version33000Date20260306120000.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Core\Migrations;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\Attributes\ModifyColumn;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

/**
* Increase bucket_name column length to 63 to match AWS bucket naming rules
*/
#[ModifyColumn(table: 'preview_locations', name: 'bucket_name', description: 'Increase column length to 63 to match AWS bucket naming rules')]
class Version33000Date20260306120000 extends SimpleMigrationStep {

#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

if ($schema->hasTable('preview_locations')) {
$table = $schema->getTable('preview_locations');
$column = $table->getColumn('bucket_name');

if ($column->getLength() < 63) {
$column->setLength(63);
}
}

return $schema;
}
}
Loading