You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
919B

  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\mysql\Schema;
  4. class m190508_155647_ajout_champs_vente_kilo extends Migration {
  5. public function up() {
  6. $this->dropColumn('product', 'sale_mode') ;
  7. $this->addColumn('product', 'unit', Schema::TYPE_STRING.' DEFAULT \'piece\'') ;
  8. $this->addColumn('product', 'step', Schema::TYPE_FLOAT.' DEFAULT 1') ;
  9. $this->dropColumn('product_order', 'sale_mode') ;
  10. $this->addColumn('product_order', 'unit', Schema::TYPE_STRING.' DEFAULT \'piece\'') ;
  11. }
  12. public function down() {
  13. $this->addColumn('product', 'sale_mode', Schema::TYPE_STRING.' DEFAULT \'unit\'') ;
  14. $this->dropColumn('product', 'unit') ;
  15. $this->dropColumn('product', 'step') ;
  16. $this->addColumn('product_order', 'sale_mode', Schema::TYPE_STRING.' DEFAULT \'unit\'') ;
  17. $this->dropColumn('product_order', 'unit') ;
  18. }
  19. }