connection->truncateTable('mounts', false); } #[Override] public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); $table = $schema->getTable('mounts'); if (!$table->hasColumn('mount_point_hash')) { $table->addColumn('mount_point_hash', Types::STRING, [ 'notnull' => true, 'length' => 32, // xxh128 ]); if ($table->hasIndex('mounts_user_root_path_index')) { $table->dropIndex('mounts_user_root_path_index'); } $table->addUniqueIndex(['user_id', 'root_id', 'mount_point_hash'], 'mounts_user_root_path_index'); return $schema; } return null; } }