-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
fix: Add migration to fix text field lengths in bookmarks table
Signed-off-by: Marcel Klehr <[email protected]>
1 parent
ceb689d
commit 7ccd738
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) 2020-2024. The Nextcloud Bookmarks contributors. | ||
* | ||
* This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. | ||
*/ | ||
|
||
namespace OCA\Bookmarks\Migration; | ||
|
||
use Closure; | ||
use Doctrine\DBAL\Schema\SchemaException; | ||
use OCA\Bookmarks\Db\Types; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version015000005Date20241229124721 extends SimpleMigrationStep { | ||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
* | ||
* @return ISchemaWrapper | ||
* | ||
* @throws SchemaException | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
if ($schema->hasTable('bookmarks')) { | ||
$table = $schema->getTable('bookmarks'); | ||
$table->modifyColumn('url', [ | ||
'length' => 4096, | ||
]); | ||
$table->modifyColumn('title', [ | ||
'length' => 4096, | ||
]); | ||
$table->modifyColumn('description', [ | ||
'length' => 4096, | ||
]); | ||
} | ||
|
||
return $schema; | ||
} | ||
|
||
} |