mirror of
https://github.com/chenasraf/cospend-nc.git
synced 2026-05-17 17:38:10 +00:00
refs #309 make encoded_icon columns larger
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<id>cospend</id>
|
||||
<name>Cospend</name>
|
||||
<summary> </summary><description> </description>
|
||||
<version>3.0.2</version>
|
||||
<version>3.0.3</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="julien-nc@posteo.net">Julien Veyssier</author>
|
||||
<namespace>Cospend</namespace>
|
||||
|
||||
49
lib/Migration/Version030003Date20241027164309.php
Normal file
49
lib/Migration/Version030003Date20241027164309.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Cospend\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
class Version030003Date20241027164309 extends SimpleMigrationStep {
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
* @return null|ISchemaWrapper
|
||||
*/
|
||||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
||||
/** @var ISchemaWrapper $schema */
|
||||
$schema = $schemaClosure();
|
||||
|
||||
$schemaChanged = false;
|
||||
|
||||
if ($schema->hasTable('cospend_categories')) {
|
||||
$table = $schema->getTable('cospend_categories');
|
||||
if ($table->hasColumn('encoded_icon')) {
|
||||
$column = $table->getColumn('encoded_icon');
|
||||
$column->setLength(256);
|
||||
$schemaChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($schema->hasTable('cospend_paymentmodes')) {
|
||||
$table = $schema->getTable('cospend_paymentmodes');
|
||||
if ($table->hasColumn('encoded_icon')) {
|
||||
$column = $table->getColumn('encoded_icon');
|
||||
$column->setLength(256);
|
||||
$schemaChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $schemaChanged ? $schema : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user