Skip to content

Commit

Permalink
Merge pull request #35 from keboola/piv-more-logging
Browse files Browse the repository at this point in the history
log table ownership
  • Loading branch information
pivnicek authored Mar 26, 2024
2 parents 96e6483 + 81fea7a commit ddb5635
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/MigrateStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,19 @@ function (GrantToRole $v) use ($database, $schemaName, $tableName) {
}

$ownershipOnTable = current($ownershipOnTable);
$this->logger->info(
sprintf(
'Ownership on table "%s"."%s" is "%s".',
$schemaName,
$tableName,
$ownershipOnTable->getGrantedTo()
)
);

$this->assignSharePrivilegesToRole($database, $ownershipOnTable->getGrantedBy());
$this->destinationConnection->useRole($ownershipOnTable->getGrantedBy());

$this->logger->info(sprintf('Creating table structure "%s"', $tableName));
$this->logger->info(sprintf('Creating table structure "%s"."%s"', $schemaName, $tableName));
try {
$this->destinationConnection->query(sprintf(
'CREATE TABLE %s.%s.%s LIKE %s.%s.%s;',
Expand Down

0 comments on commit ddb5635

Please sign in to comment.