Co-authored-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
- if ($schema->hasTable(self::TABLE_NAME)) {
- $table = $schema->getTable(self::TABLE_NAME);
- if ($table->hasIndex('user_id')) {
- $table->renameIndex('user_id', self::TABLE_NAME . '_user_id_idx');
- return $schema;
- }
- return null;
+ $table = $schema->getTable(self::TABLE_NAME);
+ if ($table->hasIndex('user_id')) {
+ $table->renameIndex('user_id', self::TABLE_NAME . '_user_id_idx');
+ return $schema;
}
-
return null;
}
}