Blame view

console/migrations/m180919_092511_customer_add_new_fields.php 778 Bytes
8a7ade31   alex   Add new fields to...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  <?php
  
  use yii\db\Migration;
  
  /**
   * Class m180919_092511_customer_add_new_fields
   */
  class m180919_092511_customer_add_new_fields extends Migration
  {
  
      public function up()
      {
  		$this->addColumn(
  			'customer',
  			'nationality',
  			$this->string()->defaultValue(0) // не указано
  		);
  
  		$this->addColumn(
  			'customer',
  			'country_from',
  			$this->string()
  		);
  
  		$this->addColumn('customer','user_work_status',
  				$this->tinyInteger()
  			);
  
  		$this->addCommentOnColumn('customer',
  			'country_from',
  			'Страна, откуда приедет юзер');
  
  
  
      }
  
      public function down()
      {
  		$this->dropColumn('customer','nationality');
  		$this->dropColumn('customer','country_from');
  		$this->dropColumn('customer','user_work_status');
  
      }
  }