Browse Source
Work with avatar identier stored in room table
Work with avatar identier stored in room table
Signed-off-by: Vitor Mattos <vitor@php.rio>pull/8333/head
committed by
Joas Schilling
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
12 changed files with 129 additions and 17 deletions
-
2appinfo/info.xml
-
4lib/Controller/AvatarController.php
-
1lib/Manager.php
-
56lib/Migration/Version16000Date20221116163301.php
-
1lib/Model/SelectHelper.php
-
11lib/Room.php
-
2lib/Search/ConversationSearch.php
-
42lib/Service/AvatarService.php
-
11lib/Service/RoomService.php
-
2tests/integration/features/bootstrap/FeatureContext.php
-
13tests/php/Chat/ChatManagerTest.php
-
1tests/php/Service/RoomServiceTest.php
@ -0,0 +1,56 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
/** |
|||
* @copyright Copyright (c) 2022 Vitor Mattos <vitor@php.rio> |
|||
* |
|||
* @author Vitor Mattos <vitor@php.rio> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\Talk\Migration; |
|||
|
|||
use Closure; |
|||
use OCP\DB\ISchemaWrapper; |
|||
use OCP\DB\Types; |
|||
use OCP\Migration\IOutput; |
|||
use OCP\Migration\SimpleMigrationStep; |
|||
|
|||
class Version16000Date20221116163301 extends SimpleMigrationStep { |
|||
/** |
|||
* @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(); |
|||
|
|||
$table = $schema->getTable('talk_rooms'); |
|||
if (!$table->hasColumn('avatar')) { |
|||
$table->addColumn('avatar', Types::STRING, [ |
|||
'notnull' => false, |
|||
'length' => 255, |
|||
]); |
|||
return $schema; |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue