Skip to content

Commit

Permalink
Merge pull request #42 from keboola/ondra-checker-different-warehouse
Browse files Browse the repository at this point in the history
use different warehouse in checker
  • Loading branch information
ondrajodas authored Oct 25, 2024
2 parents 3b06443 + 1d41472 commit 281925e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/MigrationChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ public function postMigrationCheckStructure(Role $mainRoleWithGrants): void
$warehouses = $mainRoleWithGrants->getAssignedGrants()->getWarehouseGrants();

assert(count($warehouses) > 0);
$useWarehouse = sprintf('USE WAREHOUSE %s', Helper::quoteIdentifier(current($warehouses)->getName()));
$useWarehouseSource = sprintf(
'USE WAREHOUSE %s',
Helper::quoteIdentifier($this->config->getSourceSnowflakeWarehouse()),
);
$useWarehouseDestination = sprintf(
'USE WAREHOUSE %s',
Helper::quoteIdentifier(current($warehouses)->getName()),
);

$this->sourceConnection->query($useWarehouse);
$this->destinationConnection->query($useWarehouse);
$this->sourceConnection->query($useWarehouseSource);
$this->destinationConnection->query($useWarehouseDestination);

foreach ($this->databases as $database) {
$this->logger->info(sprintf('Checking database %s', $database));
Expand Down

0 comments on commit 281925e

Please sign in to comment.