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.

45 lines
1.3KB

  1. <?php
  2. use yii\db\Migration;
  3. use yii\db\Schema;
  4. class m161208_084531_add_champs_credits_pain extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->addColumn('etablissement', 'solde_negatif', Schema::TYPE_BOOLEAN) ;
  9. $this->addColumn('credit_historique', 'id_etablissement', Schema::TYPE_INTEGER) ;
  10. $this->addColumn('credit_historique', 'moyen_paiement', Schema::TYPE_STRING) ;
  11. $this->addColumn('user_etablissement', 'credit', Schema::TYPE_FLOAT.' DEFAULT 0') ;
  12. $this->addColumn('user_etablissement', 'actif', Schema::TYPE_BOOLEAN.' DEFAULT 1') ;
  13. $this->dropColumn('user', 'credit') ;
  14. }
  15. public function down()
  16. {
  17. $this->dropColumn('etablissement', 'solde_negatif') ;
  18. $this->dropColumn('credit_historique', 'id_etablissement') ;
  19. $this->dropColumn('credit_historique', 'moyen_paiement') ;
  20. $this->dropColumn('user_etablissement', 'credit') ;
  21. $this->dropColumn('user_etablissement', 'actif') ;
  22. $this->addColumn('user', 'credit', Schema::TYPE_FLOAT) ;
  23. }
  24. /*
  25. // Use safeUp/safeDown to run migration code within a transaction
  26. public function safeUp()
  27. {
  28. }
  29. public function safeDown()
  30. {
  31. }
  32. */
  33. }