-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1032 from solverat/bigint_fix
change db type for pricing fields to BIGINT
- Loading branch information
Showing
4 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
src/CoreShop/Bundle/CoreBundle/Migrations/Version20190617082805.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace CoreShop\Bundle\CoreBundle\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\DBAL\Types\BigIntType; | ||
use Pimcore\Migrations\Migration\AbstractPimcoreMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
class Version20190617082805 extends AbstractPimcoreMigration | ||
{ | ||
public function up(Schema $schema) | ||
{ | ||
if ($schema->hasTable('coreshop_product_store_values')) { | ||
$table = $schema->getTable('coreshop_product_store_values'); | ||
if ($table->hasColumn('price')) { | ||
if (!$table->getColumn('price')->getType() instanceof BigIntType) { | ||
$this->addSql('ALTER TABLE coreshop_product_store_values CHANGE price price BIGINT NOT NULL;'); | ||
} | ||
} | ||
} | ||
|
||
if ($schema->hasTable('coreshop_product_unit_definition_price')) { | ||
$table = $schema->getTable('coreshop_product_unit_definition_price'); | ||
if ($table->hasColumn('price')) { | ||
if (!$table->getColumn('price')->getType() instanceof BigIntType) { | ||
$this->addSql('ALTER TABLE coreshop_product_unit_definition_price CHANGE price price BIGINT NOT NULL;'); | ||
} | ||
} | ||
} | ||
|
||
if ($schema->hasTable('coreshop_product_quantity_price_rule_range')) { | ||
$table = $schema->getTable('coreshop_product_quantity_price_rule_range'); | ||
if ($table->hasColumn('amount')) { | ||
if (!$table->getColumn('amount')->getType() instanceof BigIntType) { | ||
$this->addSql('ALTER TABLE coreshop_product_quantity_price_rule_range CHANGE amount amount BIGINT NOT NULL;'); | ||
} | ||
} | ||
|
||
if ($table->hasColumn('pseudo_price')) { | ||
if (!$table->getColumn('pseudo_price')->getType() instanceof BigIntType) { | ||
$this->addSql('ALTER TABLE coreshop_product_quantity_price_rule_range CHANGE pseudo_price pseudo_price BIGINT NOT NULL;'); | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters