-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #309 make encoded_icon columns larger
Signed-off-by: Julien Veyssier <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -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="[email protected]">Julien Veyssier</author> | ||
<namespace>Cospend</namespace> | ||
|
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,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; | ||
} | ||
} |