updated-packages
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
namespace Doctrine\DBAL\Schema\Synchronizer;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\Deprecations\Deprecation;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Abstract schema synchronizer with methods for executing batches of SQL.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
|
||||
{
|
||||
@@ -16,10 +19,18 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
|
||||
public function __construct(Connection $conn)
|
||||
{
|
||||
$this->conn = $conn;
|
||||
|
||||
Deprecation::trigger(
|
||||
'doctrine/dbal',
|
||||
'https://github.com/doctrine/dbal/pull/4213',
|
||||
'SchemaSynchronizer API is deprecated without a replacement and will be removed in DBAL 3.0'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $sql
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function processSqlSafely(array $sql)
|
||||
{
|
||||
@@ -33,6 +44,8 @@ abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
|
||||
|
||||
/**
|
||||
* @param string[] $sql
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function processSql(array $sql)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,8 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
/**
|
||||
* The synchronizer knows how to synchronize a schema with the configured
|
||||
* database.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
interface SchemaSynchronizer
|
||||
{
|
||||
|
||||
@@ -7,10 +7,13 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Schema\Comparator;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector;
|
||||
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Schema Synchronizer for Default DBAL Connection.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
class SingleDatabaseSynchronizer extends AbstractSchemaSynchronizer
|
||||
{
|
||||
@@ -31,7 +34,6 @@ class SingleDatabaseSynchronizer extends AbstractSchemaSynchronizer
|
||||
return $createSchema->toSql($this->platform);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -87,11 +89,14 @@ class SingleDatabaseSynchronizer extends AbstractSchemaSynchronizer
|
||||
}
|
||||
|
||||
foreach ($dropSchema->getTables() as $table) {
|
||||
if (! $table->hasPrimaryKey()) {
|
||||
$primaryKey = $table->getPrimaryKey();
|
||||
|
||||
if ($primaryKey === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$columns = $table->getPrimaryKey()->getColumns();
|
||||
$columns = $primaryKey->getColumns();
|
||||
|
||||
if (count($columns) > 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user