Skip to content

Commit

Permalink
Fix use warehouse
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrajodas committed Nov 25, 2024
1 parent 417961b commit 3c0fcb4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/MigrateStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 3c0fcb4

Please sign in to comment.