diff --git a/src/MigrateStructure.php b/src/MigrateStructure.php index 5c0e90e..80110e1 100644 --- a/src/MigrateStructure.php +++ b/src/MigrateStructure.php @@ -747,7 +747,14 @@ private function copyFunctions(string $database, ProjectRoles $projectRoles): vo ->getRole($ownershipRole->getGrantedBy()) ->getAssignedGrants() ->getWarehouseGrants(); - $this->destinationConnection->useWarehouse(current($warehouseGrants)->getName()); + + $warehouseName = current($warehouseGrants)->getName(); + try { + $this->destinationConnection->useWarehouse($warehouseName); + } catch (Throwable $e) { + $warehouseName = str_ireplace(['_SMALL', '_MEDIUM', '_LARGE'], '', $warehouseName); + $this->destinationConnection->useWarehouse($warehouseName); + } $this->destinationConnection->useRole($ownershipRole->getGrantedBy());