|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
-
-
-
- use yii\db\Schema;
- use yii\db\Migration;
-
- class m160216_155856_cdn_2_0 extends Migration
- {
- public function up()
- {
-
- $this->addColumn('user', 'adresse', Schema::TYPE_TEXT) ;
- $this->addColumn('user', 'credit', Schema::TYPE_FLOAT) ;
-
-
- $this->addColumn('commande', 'commentaire', Schema::TYPE_TEXT) ;
-
-
- $this->createTable('credit_historique', [
- 'id' => 'pk',
- 'id_user' => Schema::TYPE_INTEGER . ' NOT NULL',
- 'id_commande' => Schema::TYPE_INTEGER,
- 'date' => Schema::TYPE_DATETIME,
- 'montant' => Schema::TYPE_FLOAT,
- 'type' => Schema::TYPE_STRING.' NOT NULL'
- ]);
- }
-
- public function down()
- {
-
- $this->dropColumn('user', 'adresse') ;
- $this->dropColumn('user', 'credit') ;
-
- $this->dropColumn('commande', 'commentaire') ;
-
- $this->dropTable('credit_historique');
- }
-
-
-
- }
|