commit 9578c749a471594f49a9571ae151c1d9f869eb75
parent 0b3560079be3168d7f63abb7061c628e5860ec86
Author: Felicia Hummel <felicia@partkeepr.com>
Date: Wed, 1 Nov 2017 16:04:24 +0100
Added default values for postgreSQL to allow upgrade from 1.1.0
Diffstat:
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/PartKeepr/DistributorBundle/Entity/Distributor.php b/src/PartKeepr/DistributorBundle/Entity/Distributor.php
@@ -98,7 +98,7 @@ class Distributor extends BaseEntity
/**
* Defines if the distributor is used for pricing calculations.
*
- * @ORM\Column(type="boolean")
+ * @ORM\Column(type="boolean",options={ "default":false})
* @Groups({"default"})
*
* @var bool
diff --git a/src/PartKeepr/PartBundle/Entity/Part.php b/src/PartKeepr/PartBundle/Entity/Part.php
@@ -282,12 +282,12 @@ class Part extends BaseEntity
/**
* Defines if the part is a meta-part.
*
- * @ORM\Column(type="boolean")
+ * @ORM\Column(type="boolean", options={ "default":false})
* @Groups({"default"})
*
* @var bool
*/
- private $metaPart;
+ private $metaPart = false;
/**
* An array of all matching meta parts.
diff --git a/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php b/src/PartKeepr/ProjectBundle/Entity/ProjectPart.php
@@ -70,7 +70,7 @@ class ProjectPart extends BaseEntity
/**
* The overage type.
*
- * @ORM\Column(type="string")
+ * @ORM\Column(type="string",options={ "default":""})
* @Groups({"default"})
*
* @var string
@@ -80,7 +80,7 @@ class ProjectPart extends BaseEntity
/**
* Specifies the overage, which can either be percent or an absolute value depending on overageType.
*
- * @ORM\Column(type="integer")
+ * @ORM\Column(type="integer",options={ "default":0})
* @Groups({"default"})
*
* @var int
@@ -90,7 +90,7 @@ class ProjectPart extends BaseEntity
/**
* Specifies the lot number.
*
- * @ORM\Column(type="text")
+ * @ORM\Column(type="text",options={ "default":""})
* @Groups({"default"})
*
* @var string
@@ -115,7 +115,7 @@ class ProjectPart extends BaseEntity
{
switch ($this->getOverageType()) {
case self::OVERAGE_TYPE_PERCENT:
- return (int) $this->getQuantity() * (1 + $this->getOverage() / 100);
+ return (int)$this->getQuantity() * (1 + $this->getOverage() / 100);
case self::OVERAGE_TYPE_ABSOLUTE:
return $this->getQuantity() + $this->getOverage();
default: