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.
 
 
 

39 lines
1.4 KiB

<?php
use yii\db\Migration;
/**
* Class m191111_112559_create_table_address
*/
class m191111_112559_create_table_address extends Migration
{
/**
* {@inheritdoc}
*/
public function up()
{
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="地址表"';
$this->createTable('ats_address', [
'id' => $this->primaryKey(),
'user_id'=>$this->integer(11)->defaultValue(null)->comment('用户id'),
'consignee'=>$this->string(20)->defaultValue(null)->comment('收件人'),
'phone'=>$this->string(20)->defaultValue(null)->comment('电话'),
'province'=>$this->string(10)->defaultValue(null)->comment('省份'),
'city'=>$this->string(10)->defaultValue(null)->comment('城市'),
'area'=>$this->string(10)->defaultValue(null)->comment('区域'),
'address'=>$this->text()->comment('详细地址'),
'status'=>$this->tinyInteger(1)->defaultValue(0)->comment('状态,0-默认值 1-默认地址'),
'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
],$tableOptions);
}
/**
* {@inheritdoc}
*/
public function down()
{
$this->dropTable('ats_address');
return true;
}
}