|
|
|
@ -13,6 +13,7 @@ use Doctrine\DBAL\Schema\Schema; |
|
|
|
use Doctrine\DBAL\Schema\SchemaException; |
|
|
|
use Doctrine\DBAL\Schema\Sequence; |
|
|
|
use Doctrine\DBAL\Schema\Table; |
|
|
|
use Doctrine\DBAL\Types\Type; |
|
|
|
use OC\App\InfoParser; |
|
|
|
use OC\Migration\SimpleOutput; |
|
|
|
use OCP\App\IAppManager; |
|
|
|
@ -579,7 +580,7 @@ class MigrationService { |
|
|
|
|
|
|
|
if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { |
|
|
|
// Oracle doesn't support boolean column with non-null value
|
|
|
|
if ($thing->getNotnull() && $thing->getType()->getName() === Types::BOOLEAN) { |
|
|
|
if ($thing->getNotnull() && Type::lookupName($thing->getType()) === Types::BOOLEAN) { |
|
|
|
$thing->setNotnull(false); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -591,8 +592,8 @@ class MigrationService { |
|
|
|
|
|
|
|
// If the column was just created OR the length changed OR the type changed
|
|
|
|
// we will NOT detect invalid length if the column is not modified
|
|
|
|
if (($sourceColumn === null || $sourceColumn->getLength() !== $thing->getLength() || $sourceColumn->getType()->getName() !== Types::STRING) |
|
|
|
&& $thing->getLength() > 4000 && $thing->getType()->getName() === Types::STRING) { |
|
|
|
if (($sourceColumn === null || $sourceColumn->getLength() !== $thing->getLength() || Type::lookupName($sourceColumn->getType()) !== Types::STRING) |
|
|
|
&& $thing->getLength() > 4000 && Type::lookupName($thing->getType()) === Types::STRING) { |
|
|
|
throw new \InvalidArgumentException('Column "' . $table->getName() . '"."' . $thing->getName() . '" is type String, but exceeding the 4.000 length limit.'); |
|
|
|
} |
|
|
|
} |
|
|
|
|