<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use function array_map;
use function assert;
use function count;
use function strtolower;
class Comparator
{
public function __construct(private readonly AbstractPlatform $platform)
{
}
public function compareSchemas(Schema $oldSchema, Schema $newSchema): SchemaDiff
{
$createdSchemas = [];
$droppedSchemas = [];
$createdTables = [];
$alteredTables = [];
$droppedTables = [];
$createdSequences = [];
$alteredSequences = [];
$droppedSequences = [];
foreach ($newSchema->getNamespaces() as $newNamespace) {
if ($oldSchema->hasNamespace($newNamespace)) {
continue;
}
$createdSchemas[] = $newNamespace;
}