commit c1a7d5338bc2cf9aa77b2f0a2580bfbf0d35a11a parent 49521214a1fd175b0d8582913959ac080f273059 Author: Felicitus <felicitus@felicitus.org> Date: Fri, 27 Nov 2015 18:24:15 +0100 Added fix to avboid averagePrice being null prior upgrading, fixes #506 Diffstat:
A | src/PartKeepr/CoreBundle/DoctrineMigrations/Version20150608120000.php | | | 26 | ++++++++++++++++++++++++++ |
1 file changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/PartKeepr/CoreBundle/DoctrineMigrations/Version20150608120000.php b/src/PartKeepr/CoreBundle/DoctrineMigrations/Version20150608120000.php @@ -0,0 +1,26 @@ +<?php +namespace PartKeepr\CoreBundle\DoctrineMigrations; + + +use Doctrine\DBAL\Schema\Schema; + +class Version20150608120000 extends BaseMigration +{ + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $averagePriceFixSQL = "UPDATE Part SET averagePrice = 0 WHERE averagePrice IS NULL"; + $this->addSql($averagePriceFixSQL); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + + } +}