@@ -28,23 +28,23 @@ |
||
| 28 | 28 | use OCP\DB\QueryBuilder\IQueryFunction; |
| 29 | 29 | |
| 30 | 30 | class PgSqlFunctionBuilder extends FunctionBuilder { |
| 31 | - public function concat($x, ...$expr): IQueryFunction { |
|
| 32 | - $args = func_get_args(); |
|
| 33 | - $list = []; |
|
| 34 | - foreach ($args as $item) { |
|
| 35 | - $list[] = $this->queryBuilder->expr()->castColumn($item, IQueryBuilder::PARAM_STR); |
|
| 36 | - } |
|
| 37 | - return new QueryFunction(sprintf('(%s)', implode(' || ', $list))); |
|
| 38 | - } |
|
| 31 | + public function concat($x, ...$expr): IQueryFunction { |
|
| 32 | + $args = func_get_args(); |
|
| 33 | + $list = []; |
|
| 34 | + foreach ($args as $item) { |
|
| 35 | + $list[] = $this->queryBuilder->expr()->castColumn($item, IQueryBuilder::PARAM_STR); |
|
| 36 | + } |
|
| 37 | + return new QueryFunction(sprintf('(%s)', implode(' || ', $list))); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - public function groupConcat($expr, ?string $separator = ','): IQueryFunction { |
|
| 41 | - $castedExpression = $this->queryBuilder->expr()->castColumn($expr, IQueryBuilder::PARAM_STR); |
|
| 40 | + public function groupConcat($expr, ?string $separator = ','): IQueryFunction { |
|
| 41 | + $castedExpression = $this->queryBuilder->expr()->castColumn($expr, IQueryBuilder::PARAM_STR); |
|
| 42 | 42 | |
| 43 | - if (is_null($separator)) { |
|
| 44 | - return new QueryFunction('string_agg(' . $castedExpression . ')'); |
|
| 45 | - } |
|
| 43 | + if (is_null($separator)) { |
|
| 44 | + return new QueryFunction('string_agg(' . $castedExpression . ')'); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - $separator = $this->connection->quote($separator); |
|
| 48 | - return new QueryFunction('string_agg(' . $castedExpression . ', ' . $separator . ')'); |
|
| 49 | - } |
|
| 47 | + $separator = $this->connection->quote($separator); |
|
| 48 | + return new QueryFunction('string_agg(' . $castedExpression . ', ' . $separator . ')'); |
|
| 49 | + } |
|
| 50 | 50 | } |
@@ -24,74 +24,74 @@ |
||
| 24 | 24 | namespace OC; |
| 25 | 25 | |
| 26 | 26 | class AppScriptDependency { |
| 27 | - /** @var string */ |
|
| 28 | - private $id; |
|
| 27 | + /** @var string */ |
|
| 28 | + private $id; |
|
| 29 | 29 | |
| 30 | - /** @var array */ |
|
| 31 | - private $deps; |
|
| 30 | + /** @var array */ |
|
| 31 | + private $deps; |
|
| 32 | 32 | |
| 33 | - /** @var bool */ |
|
| 34 | - private $visited; |
|
| 33 | + /** @var bool */ |
|
| 34 | + private $visited; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @param string $id |
|
| 38 | - * @param array $deps |
|
| 39 | - * @param bool $visited |
|
| 40 | - */ |
|
| 41 | - public function __construct(string $id, array $deps = [], bool $visited = false) { |
|
| 42 | - $this->setId($id); |
|
| 43 | - $this->setDeps($deps); |
|
| 44 | - $this->setVisited($visited); |
|
| 45 | - } |
|
| 36 | + /** |
|
| 37 | + * @param string $id |
|
| 38 | + * @param array $deps |
|
| 39 | + * @param bool $visited |
|
| 40 | + */ |
|
| 41 | + public function __construct(string $id, array $deps = [], bool $visited = false) { |
|
| 42 | + $this->setId($id); |
|
| 43 | + $this->setDeps($deps); |
|
| 44 | + $this->setVisited($visited); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * @return string |
|
| 49 | - */ |
|
| 50 | - public function getId(): string { |
|
| 51 | - return $this->id; |
|
| 52 | - } |
|
| 47 | + /** |
|
| 48 | + * @return string |
|
| 49 | + */ |
|
| 50 | + public function getId(): string { |
|
| 51 | + return $this->id; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @param string $id |
|
| 56 | - */ |
|
| 57 | - public function setId(string $id): void { |
|
| 58 | - $this->id = $id; |
|
| 59 | - } |
|
| 54 | + /** |
|
| 55 | + * @param string $id |
|
| 56 | + */ |
|
| 57 | + public function setId(string $id): void { |
|
| 58 | + $this->id = $id; |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * @return array |
|
| 63 | - */ |
|
| 64 | - public function getDeps(): array { |
|
| 65 | - return $this->deps; |
|
| 66 | - } |
|
| 61 | + /** |
|
| 62 | + * @return array |
|
| 63 | + */ |
|
| 64 | + public function getDeps(): array { |
|
| 65 | + return $this->deps; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * @param array $deps |
|
| 70 | - */ |
|
| 71 | - public function setDeps(array $deps): void { |
|
| 72 | - $this->deps = $deps; |
|
| 73 | - } |
|
| 68 | + /** |
|
| 69 | + * @param array $deps |
|
| 70 | + */ |
|
| 71 | + public function setDeps(array $deps): void { |
|
| 72 | + $this->deps = $deps; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * @param string $dep |
|
| 77 | - */ |
|
| 78 | - public function addDep(string $dep): void { |
|
| 79 | - if (!in_array($dep, $this->deps, true)) { |
|
| 80 | - $this->deps[] = $dep; |
|
| 81 | - } |
|
| 82 | - } |
|
| 75 | + /** |
|
| 76 | + * @param string $dep |
|
| 77 | + */ |
|
| 78 | + public function addDep(string $dep): void { |
|
| 79 | + if (!in_array($dep, $this->deps, true)) { |
|
| 80 | + $this->deps[] = $dep; |
|
| 81 | + } |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * @return bool |
|
| 86 | - */ |
|
| 87 | - public function isVisited(): bool { |
|
| 88 | - return $this->visited; |
|
| 89 | - } |
|
| 84 | + /** |
|
| 85 | + * @return bool |
|
| 86 | + */ |
|
| 87 | + public function isVisited(): bool { |
|
| 88 | + return $this->visited; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * @param bool $visited |
|
| 93 | - */ |
|
| 94 | - public function setVisited(bool $visited): void { |
|
| 95 | - $this->visited = $visited; |
|
| 96 | - } |
|
| 91 | + /** |
|
| 92 | + * @param bool $visited |
|
| 93 | + */ |
|
| 94 | + public function setVisited(bool $visited): void { |
|
| 95 | + $this->visited = $visited; |
|
| 96 | + } |
|
| 97 | 97 | } |
@@ -29,16 +29,16 @@ |
||
| 29 | 29 | use OCP\Accounts\IAccountManager; |
| 30 | 30 | |
| 31 | 31 | trait TAccountsHelper { |
| 32 | - /** |
|
| 33 | - * returns whether the property is a collection |
|
| 34 | - */ |
|
| 35 | - protected function isCollection(string $propertyName): bool { |
|
| 36 | - return in_array( |
|
| 37 | - $propertyName, |
|
| 38 | - [ |
|
| 39 | - IAccountManager::COLLECTION_EMAIL, |
|
| 40 | - ], |
|
| 41 | - true |
|
| 42 | - ); |
|
| 43 | - } |
|
| 32 | + /** |
|
| 33 | + * returns whether the property is a collection |
|
| 34 | + */ |
|
| 35 | + protected function isCollection(string $propertyName): bool { |
|
| 36 | + return in_array( |
|
| 37 | + $propertyName, |
|
| 38 | + [ |
|
| 39 | + IAccountManager::COLLECTION_EMAIL, |
|
| 40 | + ], |
|
| 41 | + true |
|
| 42 | + ); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -32,23 +32,23 @@ |
||
| 32 | 32 | use OCP\Migration\SimpleMigrationStep; |
| 33 | 33 | |
| 34 | 34 | class Version23000Date20211203110726 extends SimpleMigrationStep { |
| 35 | - private const TABLE_NAME = 'profile_config'; |
|
| 35 | + private const TABLE_NAME = 'profile_config'; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @param IOutput $output |
|
| 39 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 40 | - * @param array $options |
|
| 41 | - * @return null|ISchemaWrapper |
|
| 42 | - */ |
|
| 43 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 44 | - /** @var ISchemaWrapper $schema */ |
|
| 45 | - $schema = $schemaClosure(); |
|
| 37 | + /** |
|
| 38 | + * @param IOutput $output |
|
| 39 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 40 | + * @param array $options |
|
| 41 | + * @return null|ISchemaWrapper |
|
| 42 | + */ |
|
| 43 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 44 | + /** @var ISchemaWrapper $schema */ |
|
| 45 | + $schema = $schemaClosure(); |
|
| 46 | 46 | |
| 47 | - $table = $schema->getTable(self::TABLE_NAME); |
|
| 48 | - if ($table->hasIndex('user_id')) { |
|
| 49 | - $table->renameIndex('user_id', self::TABLE_NAME . '_user_id_idx'); |
|
| 50 | - return $schema; |
|
| 51 | - } |
|
| 52 | - return null; |
|
| 53 | - } |
|
| 47 | + $table = $schema->getTable(self::TABLE_NAME); |
|
| 48 | + if ($table->hasIndex('user_id')) { |
|
| 49 | + $table->renameIndex('user_id', self::TABLE_NAME . '_user_id_idx'); |
|
| 50 | + return $schema; |
|
| 51 | + } |
|
| 52 | + return null; |
|
| 53 | + } |
|
| 54 | 54 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | * Defines the public facing principal option |
| 32 | 32 | */ |
| 33 | 33 | class PublicPrincipalPlugin extends Plugin { |
| 34 | - public function getCurrentPrincipal(): ?string { |
|
| 35 | - return 'principals/system/public'; |
|
| 36 | - } |
|
| 34 | + public function getCurrentPrincipal(): ?string { |
|
| 35 | + return 'principals/system/public'; |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * Set a custom principal uri to allow public requests to its calendar |
| 33 | 33 | */ |
| 34 | 34 | class CustomPrincipalPlugin extends Plugin { |
| 35 | - public function setCurrentPrincipal(?string $currentPrincipal): void { |
|
| 36 | - $this->currentPrincipal = $currentPrincipal; |
|
| 37 | - } |
|
| 35 | + public function setCurrentPrincipal(?string $currentPrincipal): void { |
|
| 36 | + $this->currentPrincipal = $currentPrincipal; |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -27,18 +27,18 @@ |
||
| 27 | 27 | namespace OCA\User_LDAP\PagedResults; |
| 28 | 28 | |
| 29 | 29 | trait TLinkId { |
| 30 | - public function getLinkId($link) { |
|
| 31 | - if (is_object($link)) { |
|
| 32 | - return spl_object_id($link); |
|
| 33 | - } elseif (is_resource($link)) { |
|
| 34 | - return (int)$link; |
|
| 35 | - } elseif (is_array($link) && isset($link[0])) { |
|
| 36 | - if (is_object($link[0])) { |
|
| 37 | - return spl_object_id($link[0]); |
|
| 38 | - } elseif (is_resource($link[0])) { |
|
| 39 | - return (int)$link[0]; |
|
| 40 | - } |
|
| 41 | - } |
|
| 42 | - throw new \RuntimeException('No resource provided'); |
|
| 43 | - } |
|
| 30 | + public function getLinkId($link) { |
|
| 31 | + if (is_object($link)) { |
|
| 32 | + return spl_object_id($link); |
|
| 33 | + } elseif (is_resource($link)) { |
|
| 34 | + return (int)$link; |
|
| 35 | + } elseif (is_array($link) && isset($link[0])) { |
|
| 36 | + if (is_object($link[0])) { |
|
| 37 | + return spl_object_id($link[0]); |
|
| 38 | + } elseif (is_resource($link[0])) { |
|
| 39 | + return (int)$link[0]; |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | + throw new \RuntimeException('No resource provided'); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -39,117 +39,117 @@ |
||
| 39 | 39 | |
| 40 | 40 | class Version2000Date20190808074233 extends SimpleMigrationStep { |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @param IOutput $output |
|
| 44 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 45 | - * @param array $options |
|
| 46 | - * @return null|ISchemaWrapper |
|
| 47 | - */ |
|
| 48 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
| 49 | - /** @var ISchemaWrapper $schema */ |
|
| 50 | - $schema = $schemaClosure(); |
|
| 42 | + /** |
|
| 43 | + * @param IOutput $output |
|
| 44 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 45 | + * @param array $options |
|
| 46 | + * @return null|ISchemaWrapper |
|
| 47 | + */ |
|
| 48 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
| 49 | + /** @var ISchemaWrapper $schema */ |
|
| 50 | + $schema = $schemaClosure(); |
|
| 51 | 51 | |
| 52 | - if (!$schema->hasTable('flow_checks')) { |
|
| 53 | - $table = $schema->createTable('flow_checks'); |
|
| 54 | - $table->addColumn('id', Types::INTEGER, [ |
|
| 55 | - 'autoincrement' => true, |
|
| 56 | - 'notnull' => true, |
|
| 57 | - 'length' => 4, |
|
| 58 | - ]); |
|
| 59 | - $table->addColumn('class', Types::STRING, [ |
|
| 60 | - 'notnull' => true, |
|
| 61 | - 'length' => 256, |
|
| 62 | - 'default' => '', |
|
| 63 | - ]); |
|
| 64 | - $table->addColumn('operator', Types::STRING, [ |
|
| 65 | - 'notnull' => true, |
|
| 66 | - 'length' => 16, |
|
| 67 | - 'default' => '', |
|
| 68 | - ]); |
|
| 69 | - $table->addColumn('value', Types::TEXT, [ |
|
| 70 | - 'notnull' => false, |
|
| 71 | - ]); |
|
| 72 | - $table->addColumn('hash', Types::STRING, [ |
|
| 73 | - 'notnull' => true, |
|
| 74 | - 'length' => 32, |
|
| 75 | - 'default' => '', |
|
| 76 | - ]); |
|
| 77 | - $table->setPrimaryKey(['id']); |
|
| 78 | - $table->addUniqueIndex(['hash'], 'flow_unique_hash'); |
|
| 79 | - } |
|
| 52 | + if (!$schema->hasTable('flow_checks')) { |
|
| 53 | + $table = $schema->createTable('flow_checks'); |
|
| 54 | + $table->addColumn('id', Types::INTEGER, [ |
|
| 55 | + 'autoincrement' => true, |
|
| 56 | + 'notnull' => true, |
|
| 57 | + 'length' => 4, |
|
| 58 | + ]); |
|
| 59 | + $table->addColumn('class', Types::STRING, [ |
|
| 60 | + 'notnull' => true, |
|
| 61 | + 'length' => 256, |
|
| 62 | + 'default' => '', |
|
| 63 | + ]); |
|
| 64 | + $table->addColumn('operator', Types::STRING, [ |
|
| 65 | + 'notnull' => true, |
|
| 66 | + 'length' => 16, |
|
| 67 | + 'default' => '', |
|
| 68 | + ]); |
|
| 69 | + $table->addColumn('value', Types::TEXT, [ |
|
| 70 | + 'notnull' => false, |
|
| 71 | + ]); |
|
| 72 | + $table->addColumn('hash', Types::STRING, [ |
|
| 73 | + 'notnull' => true, |
|
| 74 | + 'length' => 32, |
|
| 75 | + 'default' => '', |
|
| 76 | + ]); |
|
| 77 | + $table->setPrimaryKey(['id']); |
|
| 78 | + $table->addUniqueIndex(['hash'], 'flow_unique_hash'); |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - if (!$schema->hasTable('flow_operations')) { |
|
| 82 | - $table = $schema->createTable('flow_operations'); |
|
| 83 | - $table->addColumn('id', Types::INTEGER, [ |
|
| 84 | - 'autoincrement' => true, |
|
| 85 | - 'notnull' => true, |
|
| 86 | - 'length' => 4, |
|
| 87 | - ]); |
|
| 88 | - $table->addColumn('class', Types::STRING, [ |
|
| 89 | - 'notnull' => true, |
|
| 90 | - 'length' => 256, |
|
| 91 | - 'default' => '', |
|
| 92 | - ]); |
|
| 93 | - $table->addColumn('name', Types::STRING, [ |
|
| 94 | - 'notnull' => false, |
|
| 95 | - 'length' => 256, |
|
| 96 | - 'default' => '', |
|
| 97 | - ]); |
|
| 98 | - $table->addColumn('checks', Types::TEXT, [ |
|
| 99 | - 'notnull' => false, |
|
| 100 | - ]); |
|
| 101 | - $table->addColumn('operation', Types::TEXT, [ |
|
| 102 | - 'notnull' => false, |
|
| 103 | - ]); |
|
| 104 | - $this->ensureEntityColumns($table); |
|
| 105 | - $table->setPrimaryKey(['id']); |
|
| 106 | - } else { |
|
| 107 | - $table = $schema->getTable('flow_operations'); |
|
| 108 | - $this->ensureEntityColumns($table); |
|
| 109 | - } |
|
| 81 | + if (!$schema->hasTable('flow_operations')) { |
|
| 82 | + $table = $schema->createTable('flow_operations'); |
|
| 83 | + $table->addColumn('id', Types::INTEGER, [ |
|
| 84 | + 'autoincrement' => true, |
|
| 85 | + 'notnull' => true, |
|
| 86 | + 'length' => 4, |
|
| 87 | + ]); |
|
| 88 | + $table->addColumn('class', Types::STRING, [ |
|
| 89 | + 'notnull' => true, |
|
| 90 | + 'length' => 256, |
|
| 91 | + 'default' => '', |
|
| 92 | + ]); |
|
| 93 | + $table->addColumn('name', Types::STRING, [ |
|
| 94 | + 'notnull' => false, |
|
| 95 | + 'length' => 256, |
|
| 96 | + 'default' => '', |
|
| 97 | + ]); |
|
| 98 | + $table->addColumn('checks', Types::TEXT, [ |
|
| 99 | + 'notnull' => false, |
|
| 100 | + ]); |
|
| 101 | + $table->addColumn('operation', Types::TEXT, [ |
|
| 102 | + 'notnull' => false, |
|
| 103 | + ]); |
|
| 104 | + $this->ensureEntityColumns($table); |
|
| 105 | + $table->setPrimaryKey(['id']); |
|
| 106 | + } else { |
|
| 107 | + $table = $schema->getTable('flow_operations'); |
|
| 108 | + $this->ensureEntityColumns($table); |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - if (!$schema->hasTable('flow_operations_scope')) { |
|
| 112 | - $table = $schema->createTable('flow_operations_scope'); |
|
| 113 | - $table->addColumn('id', Types::BIGINT, [ |
|
| 114 | - 'autoincrement' => true, |
|
| 115 | - 'notnull' => true, |
|
| 116 | - 'length' => 4, |
|
| 117 | - ]); |
|
| 118 | - $table->addColumn('operation_id', Types::INTEGER, [ |
|
| 119 | - 'notnull' => true, |
|
| 120 | - 'length' => 4, |
|
| 121 | - 'default' => 0, |
|
| 122 | - ]); |
|
| 123 | - $table->addColumn('type', Types::INTEGER, [ |
|
| 124 | - 'notnull' => true, |
|
| 125 | - 'length' => 4, |
|
| 126 | - 'default' => 0, |
|
| 127 | - ]); |
|
| 128 | - $table->addColumn('value', Types::STRING, [ |
|
| 129 | - 'notnull' => false, |
|
| 130 | - 'length' => 64, |
|
| 131 | - 'default' => '', |
|
| 132 | - ]); |
|
| 133 | - $table->setPrimaryKey(['id']); |
|
| 134 | - $table->addUniqueIndex(['operation_id', 'type', 'value'], 'flow_unique_scope'); |
|
| 135 | - } |
|
| 111 | + if (!$schema->hasTable('flow_operations_scope')) { |
|
| 112 | + $table = $schema->createTable('flow_operations_scope'); |
|
| 113 | + $table->addColumn('id', Types::BIGINT, [ |
|
| 114 | + 'autoincrement' => true, |
|
| 115 | + 'notnull' => true, |
|
| 116 | + 'length' => 4, |
|
| 117 | + ]); |
|
| 118 | + $table->addColumn('operation_id', Types::INTEGER, [ |
|
| 119 | + 'notnull' => true, |
|
| 120 | + 'length' => 4, |
|
| 121 | + 'default' => 0, |
|
| 122 | + ]); |
|
| 123 | + $table->addColumn('type', Types::INTEGER, [ |
|
| 124 | + 'notnull' => true, |
|
| 125 | + 'length' => 4, |
|
| 126 | + 'default' => 0, |
|
| 127 | + ]); |
|
| 128 | + $table->addColumn('value', Types::STRING, [ |
|
| 129 | + 'notnull' => false, |
|
| 130 | + 'length' => 64, |
|
| 131 | + 'default' => '', |
|
| 132 | + ]); |
|
| 133 | + $table->setPrimaryKey(['id']); |
|
| 134 | + $table->addUniqueIndex(['operation_id', 'type', 'value'], 'flow_unique_scope'); |
|
| 135 | + } |
|
| 136 | 136 | |
| 137 | - return $schema; |
|
| 138 | - } |
|
| 137 | + return $schema; |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - protected function ensureEntityColumns(Table $table) { |
|
| 141 | - if (!$table->hasColumn('entity')) { |
|
| 142 | - $table->addColumn('entity', Types::STRING, [ |
|
| 143 | - 'notnull' => true, |
|
| 144 | - 'length' => 256, |
|
| 145 | - 'default' => File::class, |
|
| 146 | - ]); |
|
| 147 | - } |
|
| 148 | - if (!$table->hasColumn('events')) { |
|
| 149 | - $table->addColumn('events', Types::TEXT, [ |
|
| 150 | - 'notnull' => true, |
|
| 151 | - 'default' => '[]', |
|
| 152 | - ]); |
|
| 153 | - } |
|
| 154 | - } |
|
| 140 | + protected function ensureEntityColumns(Table $table) { |
|
| 141 | + if (!$table->hasColumn('entity')) { |
|
| 142 | + $table->addColumn('entity', Types::STRING, [ |
|
| 143 | + 'notnull' => true, |
|
| 144 | + 'length' => 256, |
|
| 145 | + 'default' => File::class, |
|
| 146 | + ]); |
|
| 147 | + } |
|
| 148 | + if (!$table->hasColumn('events')) { |
|
| 149 | + $table->addColumn('events', Types::TEXT, [ |
|
| 150 | + 'notnull' => true, |
|
| 151 | + 'default' => '[]', |
|
| 152 | + ]); |
|
| 153 | + } |
|
| 154 | + } |
|
| 155 | 155 | } |
@@ -32,25 +32,25 @@ |
||
| 32 | 32 | use OCP\Migration\SimpleMigrationStep; |
| 33 | 33 | |
| 34 | 34 | class Version1130Date20220110154719 extends SimpleMigrationStep { |
| 35 | - public function getName() { |
|
| 36 | - return 'Drop ldap_group_mapping_backup'; |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @param IOutput $output |
|
| 41 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 42 | - * @param array $options |
|
| 43 | - * @return null|ISchemaWrapper |
|
| 44 | - */ |
|
| 45 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 46 | - /** @var ISchemaWrapper $schema */ |
|
| 47 | - $schema = $schemaClosure(); |
|
| 48 | - |
|
| 49 | - if ($schema->hasTable('ldap_group_mapping_backup')) { |
|
| 50 | - $schema->dropTable('ldap_group_mapping_backup'); |
|
| 51 | - return $schema; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - return null; |
|
| 55 | - } |
|
| 35 | + public function getName() { |
|
| 36 | + return 'Drop ldap_group_mapping_backup'; |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @param IOutput $output |
|
| 41 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 42 | + * @param array $options |
|
| 43 | + * @return null|ISchemaWrapper |
|
| 44 | + */ |
|
| 45 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 46 | + /** @var ISchemaWrapper $schema */ |
|
| 47 | + $schema = $schemaClosure(); |
|
| 48 | + |
|
| 49 | + if ($schema->hasTable('ldap_group_mapping_backup')) { |
|
| 50 | + $schema->dropTable('ldap_group_mapping_backup'); |
|
| 51 | + return $schema; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + return null; |
|
| 55 | + } |
|
| 56 | 56 | } |