protected function generateColumns($table)
{
$columns = [];
$needPK = true;
foreach ($table->columns as $column) {
if ($column->autoIncrement) {
$columns[$column->name] = $column->type == Schema::TYPE_BIGINT ? '$this->bigPrimaryKey()' : '$this->primaryKey()';
$needPK = false;
continue;
}
$columns[$column->name] = $this->getSchemaType($column);
}
if ($needPK && !empty($table->primaryKey)) {
$pks = implode(']], [[', $table->primaryKey);
$columns[0] = "PRIMARY KEY ([[{$pks}]])";
}
return $columns;
}