Skip to content

Commit b6bdb36

Browse files
committed
feat(select): add migration to add options column to profile_fields_definitions
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent aa8181e commit b6bdb36

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/**
4+
* SPDX-FileCopyrightText: 2026 LibreCode coop and LibreCode contributors
5+
* SPDX-License-Identifier: AGPL-3.0-or-later
6+
*/
7+
8+
declare(strict_types=1);
9+
10+
namespace OCA\ProfileFields\Migration;
11+
12+
use Closure;
13+
use OCP\DB\ISchemaWrapper;
14+
use OCP\DB\Types;
15+
use OCP\Migration\IOutput;
16+
use OCP\Migration\SimpleMigrationStep;
17+
18+
class Version1001Date20260317120000 extends SimpleMigrationStep {
19+
/**
20+
* @param IOutput $output
21+
* @param Closure(): ISchemaWrapper $schemaClosure
22+
* @param array $options
23+
*/
24+
#[\Override]
25+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
26+
/** @var ISchemaWrapper $schema */
27+
$schema = $schemaClosure();
28+
29+
$table = $schema->getTable('profile_fields_definitions');
30+
31+
if (!$table->hasColumn('options')) {
32+
$table->addColumn('options', Types::TEXT, [
33+
'notnull' => false,
34+
'default' => null,
35+
]);
36+
}
37+
38+
return $schema;
39+
}
40+
}

0 commit comments

Comments
 (0)