composer update
This commit is contained in:
@@ -1,41 +1,16 @@
|
||||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\DBAL\Schema;
|
||||
|
||||
use \Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use function array_merge;
|
||||
|
||||
/**
|
||||
* Schema Diff.
|
||||
*
|
||||
* @link www.doctrine-project.org
|
||||
* @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
* @since 2.0
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
*/
|
||||
class SchemaDiff
|
||||
{
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Schema\Schema
|
||||
*/
|
||||
/** @var Schema */
|
||||
public $fromSchema;
|
||||
|
||||
/**
|
||||
@@ -55,53 +30,44 @@ class SchemaDiff
|
||||
/**
|
||||
* All added tables.
|
||||
*
|
||||
* @var \Doctrine\DBAL\Schema\Table[]
|
||||
* @var Table[]
|
||||
*/
|
||||
public $newTables = [];
|
||||
|
||||
/**
|
||||
* All changed tables.
|
||||
*
|
||||
* @var \Doctrine\DBAL\Schema\TableDiff[]
|
||||
* @var TableDiff[]
|
||||
*/
|
||||
public $changedTables = [];
|
||||
|
||||
/**
|
||||
* All removed tables.
|
||||
*
|
||||
* @var \Doctrine\DBAL\Schema\Table[]
|
||||
* @var Table[]
|
||||
*/
|
||||
public $removedTables = [];
|
||||
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Schema\Sequence[]
|
||||
*/
|
||||
/** @var Sequence[] */
|
||||
public $newSequences = [];
|
||||
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Schema\Sequence[]
|
||||
*/
|
||||
/** @var Sequence[] */
|
||||
public $changedSequences = [];
|
||||
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Schema\Sequence[]
|
||||
*/
|
||||
/** @var Sequence[] */
|
||||
public $removedSequences = [];
|
||||
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Schema\ForeignKeyConstraint[]
|
||||
*/
|
||||
/** @var ForeignKeyConstraint[] */
|
||||
public $orphanedForeignKeys = [];
|
||||
|
||||
/**
|
||||
* Constructs an SchemaDiff object.
|
||||
*
|
||||
* @param \Doctrine\DBAL\Schema\Table[] $newTables
|
||||
* @param \Doctrine\DBAL\Schema\TableDiff[] $changedTables
|
||||
* @param \Doctrine\DBAL\Schema\Table[] $removedTables
|
||||
* @param \Doctrine\DBAL\Schema\Schema|null $fromSchema
|
||||
* @param Table[] $newTables
|
||||
* @param TableDiff[] $changedTables
|
||||
* @param Table[] $removedTables
|
||||
*/
|
||||
public function __construct($newTables = [], $changedTables = [], $removedTables = [], Schema $fromSchema = null)
|
||||
public function __construct($newTables = [], $changedTables = [], $removedTables = [], ?Schema $fromSchema = null)
|
||||
{
|
||||
$this->newTables = $newTables;
|
||||
$this->changedTables = $changedTables;
|
||||
@@ -118,9 +84,7 @@ class SchemaDiff
|
||||
*
|
||||
* This way it is ensured that assets are deleted which might not be relevant to the metadata schema at all.
|
||||
*
|
||||
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
|
||||
*
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
public function toSaveSql(AbstractPlatform $platform)
|
||||
{
|
||||
@@ -128,9 +92,7 @@ class SchemaDiff
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
|
||||
*
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
public function toSql(AbstractPlatform $platform)
|
||||
{
|
||||
@@ -138,10 +100,9 @@ class SchemaDiff
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
|
||||
* @param bool $saveMode
|
||||
* @param bool $saveMode
|
||||
*
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
protected function _toSql(AbstractPlatform $platform, $saveMode = false)
|
||||
{
|
||||
@@ -153,13 +114,13 @@ class SchemaDiff
|
||||
}
|
||||
}
|
||||
|
||||
if ($platform->supportsForeignKeyConstraints() && $saveMode == false) {
|
||||
if ($platform->supportsForeignKeyConstraints() && $saveMode === false) {
|
||||
foreach ($this->orphanedForeignKeys as $orphanedForeignKey) {
|
||||
$sql[] = $platform->getDropForeignKeySQL($orphanedForeignKey, $orphanedForeignKey->getLocalTable());
|
||||
}
|
||||
}
|
||||
|
||||
if ($platform->supportsSequences() == true) {
|
||||
if ($platform->supportsSequences() === true) {
|
||||
foreach ($this->changedSequences as $sequence) {
|
||||
$sql[] = $platform->getAlterSequenceSQL($sequence);
|
||||
}
|
||||
@@ -182,10 +143,12 @@ class SchemaDiff
|
||||
$platform->getCreateTableSQL($table, AbstractPlatform::CREATE_INDEXES)
|
||||
);
|
||||
|
||||
if ($platform->supportsForeignKeyConstraints()) {
|
||||
foreach ($table->getForeignKeys() as $foreignKey) {
|
||||
$foreignKeySql[] = $platform->getCreateForeignKeySQL($foreignKey, $table);
|
||||
}
|
||||
if (! $platform->supportsForeignKeyConstraints()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($table->getForeignKeys() as $foreignKey) {
|
||||
$foreignKeySql[] = $platform->getCreateForeignKeySQL($foreignKey, $table);
|
||||
}
|
||||
}
|
||||
$sql = array_merge($sql, $foreignKeySql);
|
||||
|
Reference in New Issue
Block a user