|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it) |
| 4 | + * |
| 5 | + * @license GNU AGPL version 3 or any later version |
| 6 | + * |
| 7 | + * This program is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU Affero General Public License as |
| 9 | + * published by the Free Software Foundation, either version 3 of the |
| 10 | + * License, or (at your option) any later version. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU Affero General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU Affero General Public License |
| 18 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | + * |
| 20 | + */ |
| 21 | + |
| 22 | +declare(strict_types=1); |
| 23 | + |
| 24 | + |
| 25 | +namespace OCA\Deck\Migration; |
| 26 | + |
| 27 | +use Closure; |
| 28 | +use OCP\DB\ISchemaWrapper; |
| 29 | +use OCP\DB\Types; |
| 30 | +use OCP\Migration\IOutput; |
| 31 | +use OCP\Migration\SimpleMigrationStep; |
| 32 | + |
| 33 | +class Version11000Date20240222115515 extends SimpleMigrationStep { |
| 34 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
| 35 | + $schema = $schemaClosure(); |
| 36 | + |
| 37 | + $assigned_users_table = $schema->getTable('deck_assigned_users'); |
| 38 | + if($assigned_users_table->hasIndex('deck_assigned_users_idx_c')) { |
| 39 | + $assigned_users_table->dropIndex('deck_assigned_users_idx_c'); |
| 40 | + } |
| 41 | + |
| 42 | + $board_acl_table = $schema->getTable('deck_board_acl'); |
| 43 | + if($board_acl_table->hasIndex('deck_board_acl_idx_i')) { |
| 44 | + $board_acl_table->dropIndex('deck_board_acl_idx_i'); |
| 45 | + } |
| 46 | + return $schema; |
| 47 | + } |
| 48 | +} |
0 commit comments