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.

40 lines
1.7KB

  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. class m161222_100015_champs_point_vente_jours_livraison extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->addColumn('point_vente', 'livraison_lundi', Schema::TYPE_BOOLEAN) ;
  9. $this->addColumn('point_vente', 'livraison_mardi', Schema::TYPE_BOOLEAN) ;
  10. $this->addColumn('point_vente', 'livraison_mercredi', Schema::TYPE_BOOLEAN) ;
  11. $this->addColumn('point_vente', 'livraison_jeudi', Schema::TYPE_BOOLEAN) ;
  12. $this->addColumn('point_vente', 'livraison_vendredi', Schema::TYPE_BOOLEAN) ;
  13. $this->addColumn('point_vente', 'livraison_samedi', Schema::TYPE_BOOLEAN) ;
  14. $this->addColumn('point_vente', 'livraison_dimanche', Schema::TYPE_BOOLEAN) ;
  15. $this->createTable('production_point_vente', [
  16. 'id_production' => Schema::TYPE_INTEGER.' NOT NULL',
  17. 'id_point_vente' => Schema::TYPE_INTEGER.' NOT NULL',
  18. 'livraison' => Schema::TYPE_BOOLEAN.' DEFAULT 0',
  19. ]);
  20. $this->addPrimaryKey('production_point_vente_pk', 'production_point_vente', ['id_production', 'id_point_vente']);
  21. }
  22. public function down()
  23. {
  24. $this->dropColumn('point_vente', 'livraison_lundi') ;
  25. $this->dropColumn('point_vente', 'livraison_mardi') ;
  26. $this->dropColumn('point_vente', 'livraison_mercredi') ;
  27. $this->dropColumn('point_vente', 'livraison_jeudi') ;
  28. $this->dropColumn('point_vente', 'livraison_vendredi') ;
  29. $this->dropColumn('point_vente', 'livraison_samedi') ;
  30. $this->dropColumn('point_vente', 'livraison_dimanche') ;
  31. $this->dropTable('production_point_vente') ;
  32. }
  33. }