Skip to content

Commit c0b0ebb

Browse files
mintsoftjuliusknorr
authored andcommitted
Applying variable naming scheme, returning schema only if changes are made for performance and removing the original
creation of the indicies for new installations Signed-off-by: Rob Emery <git@mintsoft.net>
1 parent d841c96 commit c0b0ebb

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

lib/Migration/Version1000Date20200306161713.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
271271
]);
272272
$table->setPrimaryKey(['id']);
273273
$table->addIndex(['participant'], 'deck_assigned_users_idx_p');
274-
$table->addIndex(['card_id'], 'deck_assigned_users_idx_c');
274+
//$table->addIndex(['card_id'], 'deck_assigned_users_idx_c');
275275
}
276276

277277
if (!$schema->hasTable('deck_board_acl')) {
@@ -307,7 +307,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
307307
]);
308308
$table->setPrimaryKey(['id']);
309309
$table->addUniqueIndex(['board_id', 'type', 'participant'], 'deck_board_acl_uq_i');
310-
$table->addIndex(['board_id'], 'deck_board_acl_idx_i');
310+
//$table->addIndex(['board_id'], 'deck_board_acl_idx_i');
311311
}
312312
return $schema;
313313
}

lib/Migration/Version11000Date20240222115515.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,19 @@
3333
class Version11000Date20240222115515 extends SimpleMigrationStep {
3434
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
3535
$schema = $schemaClosure();
36+
$returnValue = NULL;
3637

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');
38+
$assignedUsersTable = $schema->getTable('deck_assigned_users');
39+
if($assignedUsersTable->hasIndex('deck_assigned_users_idx_c')) {
40+
$assignedUsersTable->dropIndex('deck_assigned_users_idx_c');
41+
$returnValue = $schema;
4042
}
4143

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');
44+
$boardAclTable = $schema->getTable('deck_board_acl');
45+
if($boardAclTable->hasIndex('deck_board_acl_idx_i')) {
46+
$boardAclTable->dropIndex('deck_board_acl_idx_i');
47+
$returnValue = $schema;
4548
}
46-
return $schema;
49+
return $returnValue;
4750
}
4851
}

0 commit comments

Comments
 (0)