|
- <?php
-
- use yii\db\Migration;
- use yii\db\Schema;
-
- class m161208_084531_add_champs_credits_pain extends Migration
- {
- public function up()
- {
- $this->addColumn('etablissement', 'solde_negatif', Schema::TYPE_BOOLEAN) ;
-
- $this->addColumn('credit_historique', 'id_etablissement', Schema::TYPE_INTEGER) ;
- $this->addColumn('credit_historique', 'moyen_paiement', Schema::TYPE_STRING) ;
-
- $this->addColumn('user_etablissement', 'credit', Schema::TYPE_FLOAT.' DEFAULT 0') ;
- $this->addColumn('user_etablissement', 'actif', Schema::TYPE_BOOLEAN.' DEFAULT 1') ;
-
- $this->dropColumn('user', 'credit') ;
- }
-
- public function down()
- {
- $this->dropColumn('etablissement', 'solde_negatif') ;
-
- $this->dropColumn('credit_historique', 'id_etablissement') ;
- $this->dropColumn('credit_historique', 'moyen_paiement') ;
-
- $this->dropColumn('user_etablissement', 'credit') ;
- $this->dropColumn('user_etablissement', 'actif') ;
-
- $this->addColumn('user', 'credit', Schema::TYPE_FLOAT) ;
- }
-
- /*
- // Use safeUp/safeDown to run migration code within a transaction
- public function safeUp()
- {
- }
-
- public function safeDown()
- {
- }
- */
- }
|