From 7c0670fe5dfb1c31cade8d9d6d7c7e538bd37fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jodas?= Date: Fri, 25 Oct 2024 13:29:51 +0200 Subject: [PATCH 1/2] use different warehouse in checker --- src/MigrationChecker.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/MigrationChecker.php b/src/MigrationChecker.php index 35c73ac..e778b29 100644 --- a/src/MigrationChecker.php +++ b/src/MigrationChecker.php @@ -28,10 +28,15 @@ 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)); From 1d41472807a5ca0bdeeb7c03a84c93f8d0633fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Jodas?= Date: Fri, 25 Oct 2024 13:47:25 +0200 Subject: [PATCH 2/2] fix phpcs --- src/MigrationChecker.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MigrationChecker.php b/src/MigrationChecker.php index e778b29..8ba05a9 100644 --- a/src/MigrationChecker.php +++ b/src/MigrationChecker.php @@ -29,10 +29,12 @@ public function postMigrationCheckStructure(Role $mainRoleWithGrants): void assert(count($warehouses) > 0); $useWarehouseSource = sprintf( - 'USE WAREHOUSE %s', Helper::quoteIdentifier($this->config->getSourceSnowflakeWarehouse()), + 'USE WAREHOUSE %s', + Helper::quoteIdentifier($this->config->getSourceSnowflakeWarehouse()), ); $useWarehouseDestination = sprintf( - 'USE WAREHOUSE %s', Helper::quoteIdentifier(current($warehouses)->getName()), + 'USE WAREHOUSE %s', + Helper::quoteIdentifier(current($warehouses)->getName()), ); $this->sourceConnection->query($useWarehouseSource);