From 9c14810206e4c74a82749dcf34f721ae360def7b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Mar 2026 17:48:29 +0000 Subject: [PATCH] fix: increase bucket_name column length to 63 chars AWS allows bucket names up to 63 characters per their naming rules, but the bucket_name column in oc_preview_locations was varchar(40). This updates the initial migration to use length 63 for fresh installs and adds a new migration to alter the column for existing installs. Fixes: #58755 Signed-off-by: boris324 Co-Authored-By: Claude Opus 4.6 --- .../Version33000Date20250819110529.php | 2 +- .../Version33000Date20260306120000.php | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 core/Migrations/Version33000Date20260306120000.php diff --git a/core/Migrations/Version33000Date20250819110529.php b/core/Migrations/Version33000Date20250819110529.php index 570a2ee72d429..41f3e37a8128d 100644 --- a/core/Migrations/Version33000Date20250819110529.php +++ b/core/Migrations/Version33000Date20250819110529.php @@ -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']); } diff --git a/core/Migrations/Version33000Date20260306120000.php b/core/Migrations/Version33000Date20260306120000.php new file mode 100644 index 0000000000000..d86f7d5304d26 --- /dev/null +++ b/core/Migrations/Version33000Date20260306120000.php @@ -0,0 +1,40 @@ +hasTable('preview_locations')) { + $table = $schema->getTable('preview_locations'); + $column = $table->getColumn('bucket_name'); + + if ($column->getLength() < 63) { + $column->setLength(63); + } + } + + return $schema; + } +}