Skip to content

Commit

Permalink
log table ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
pivnicek committed Mar 26, 2024
1 parent 96e6483 commit 81fea7a
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 81fea7a

Please sign in to comment.