|
|
@ -279,11 +279,11 @@ class QueryBuilder extends \yii\base\Object |
|
|
|
public function addPrimaryKey($name, $table, $columns) |
|
|
|
public function addPrimaryKey($name, $table, $columns) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (is_string($columns)) { |
|
|
|
if (is_string($columns)) { |
|
|
|
$columns=preg_split('/\s*,\s*/',$columns,-1,PREG_SPLIT_NO_EMPTY); |
|
|
|
$columns = preg_split('/\s*,\s*/', $columns, -1, PREG_SPLIT_NO_EMPTY); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach ($columns as $i=>$col) { |
|
|
|
foreach ($columns as $i => $col) { |
|
|
|
$columns[$i]=$this->db->quoteColumnName($col); |
|
|
|
$columns[$i] = $this->db->quoteColumnName($col); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return 'ALTER TABLE ' . $this->db->quoteTableName($table) . ' ADD CONSTRAINT ' |
|
|
|
return 'ALTER TABLE ' . $this->db->quoteTableName($table) . ' ADD CONSTRAINT ' |
|
|
@ -301,7 +301,6 @@ class QueryBuilder extends \yii\base\Object |
|
|
|
{ |
|
|
|
{ |
|
|
|
return 'ALTER TABLE ' . $this->db->quoteTableName($table) |
|
|
|
return 'ALTER TABLE ' . $this->db->quoteTableName($table) |
|
|
|
. ' DROP CONSTRAINT ' . $this->db->quoteColumnName($name); |
|
|
|
. ' DROP CONSTRAINT ' . $this->db->quoteColumnName($name); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|