PageRenderTime 50ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/src/OroCRM/Bundle/MagentoBundle/Migrations/Schema/v1_2/OroCrmMagentoBundle.php

https://github.com/jrcollado1987/crm
PHP | 56 lines | 46 code | 7 blank | 3 comment | 0 complexity | 4e2e711a5a4ac825e212a071efb6066e MD5 | raw file
  1. <?php
  2. namespace OroCRM\Bundle\MagentoBundle\Migrations\Schema\v1_2;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\DBAL\Types\Type;
  5. use Oro\Bundle\MigrationBundle\Migration\Migration;
  6. use Oro\Bundle\MigrationBundle\Migration\QueryBag;
  7. class OroCRMMagentoBundle implements Migration
  8. {
  9. /**
  10. * @inheritdoc
  11. */
  12. public function up(Schema $schema, QueryBag $queries)
  13. {
  14. $table = $schema->getTable('orocrm_magento_order_items');
  15. $table->getColumn('original_price')->setType(Type::getType('money'));
  16. $table->getColumn('discount_percent')->setType(Type::getType('percent'));
  17. $table->getColumn('price')->setType(Type::getType('money'));
  18. $table->getColumn('tax_percent')->setType(Type::getType('percent'));
  19. $table->getColumn('tax_amount')->setType(Type::getType('money'));
  20. $table->getColumn('discount_amount')->setType(Type::getType('money'));
  21. $table->getColumn('row_total')->setType(Type::getType('money'));
  22. $table = $schema->getTable('orocrm_magento_product');
  23. $table->getColumn('special_price')->setType(Type::getType('money'));
  24. $table->getColumn('price')->setType(Type::getType('money'));
  25. $table->getColumn('cost')->setType(Type::getType('money'));
  26. $table = $schema->getTable('orocrm_magento_cart');
  27. $table->getColumn('sub_total')->setType(Type::getType('money'));
  28. $table->getColumn('grand_total')->setType(Type::getType('money'));
  29. $table->getColumn('tax_amount')->setType(Type::getType('money'));
  30. $table = $schema->getTable('orocrm_magento_order');
  31. $table->getColumn('total_invoiced_amount')->setType(Type::getType('money'));
  32. $table->getColumn('total_refunded_amount')->setType(Type::getType('money'));
  33. $table->getColumn('total_canceled_amount')->setType(Type::getType('money'));
  34. $table->getColumn('subtotal_amount')->setType(Type::getType('money'));
  35. $table->getColumn('shipping_amount')->setType(Type::getType('money'));
  36. $table->getColumn('tax_amount')->setType(Type::getType('money'));
  37. $table->getColumn('discount_amount')->setType(Type::getType('money'));
  38. $table->getColumn('total_amount')->setType(Type::getType('money'));
  39. $table->getColumn('discount_percent')->setType(Type::getType('percent'));
  40. $table = $schema->getTable('orocrm_magento_cart_item');
  41. $table->getColumn('custom_price')->setType(Type::getType('money'));
  42. $table->getColumn('price_incl_tax')->setType(Type::getType('money'));
  43. $table->getColumn('row_total')->setType(Type::getType('money'));
  44. $table->getColumn('tax_amount')->setType(Type::getType('money'));
  45. $table->getColumn('price')->setType(Type::getType('money'));
  46. $table->getColumn('discount_amount')->setType(Type::getType('money'));
  47. $table->getColumn('tax_percent')->setType(Type::getType('percent'));
  48. }
  49. }