DDC-525 - Single Table Inheritance fields of child entities ALWAYS have to be nullable, Schema-Tool now enforces this.
This commit is contained in:
parent
84bd843eed
commit
394469d4b7
@ -299,6 +299,9 @@ class SchemaTool
|
||||
$options = array();
|
||||
$options['length'] = isset($mapping['length']) ? $mapping['length'] : null;
|
||||
$options['notnull'] = isset($mapping['nullable']) ? ! $mapping['nullable'] : true;
|
||||
if ($class->isInheritanceTypeSingleTable() && count($class->parentClasses) > 0) {
|
||||
$options['notnull'] = false;
|
||||
}
|
||||
|
||||
$options['platformOptions'] = array();
|
||||
$options['platformOptions']['version'] = $class->isVersioned && $class->versionField == $mapping['fieldName'] ? true : false;
|
||||
|
@ -8,7 +8,7 @@ namespace Doctrine\Tests\Models\Company;
|
||||
class CompanyFixContract extends CompanyContract
|
||||
{
|
||||
/**
|
||||
* @column(type="integer", nullable=true)
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $fixPrice = 0;
|
||||
|
@ -7,13 +7,13 @@ namespace Doctrine\Tests\Models\Company;
|
||||
class CompanyFlexContract extends CompanyContract
|
||||
{
|
||||
/**
|
||||
* @column(type="integer", nullable=true)
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $hoursWorked = 0;
|
||||
|
||||
/**
|
||||
* @column(type="integer", nullable=true)
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $pricePerHour = 0;
|
||||
|
@ -8,7 +8,7 @@ namespace Doctrine\Tests\Models\Company;
|
||||
class CompanyFlexUltraContract extends CompanyFlexContract
|
||||
{
|
||||
/**
|
||||
* @column(type="integer", nullable=true)
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $maxPrice = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user