createTable('{{%address}}', [ 'id' => Schema::TYPE_PK, 'user_id' => $this->integer(11)->notNull()->comment('用户ID'), 'name' => Schema::TYPE_STRING . "(20) NOT NULL COMMENT '收货人'", 'tel' => Schema::TYPE_STRING . "(11) NOT NULL COMMENT '手机号'", 'province' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '省份'", 'city' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '城市'", 'area' => Schema::TYPE_STRING . "(50) NOT NULL COMMENT '区域'", 'detail' => Schema::TYPE_STRING . "(200) NOT NULL COMMENT '详细地址'", 'created_at' => Schema::TYPE_INTEGER . "(11) NOT NULL", 'updated_at' => Schema::TYPE_INTEGER . "(11) NOT NULL", 'status' => Schema::TYPE_SMALLINT . "(1) NOT NULL DEFAULT '1' COMMENT '状态'", ], $this->tableOptions); } /** * @inheritdoc */ public function down() { $this->dropTable('{{%address}}'); } }