@@ -375,9 +375,9 @@ discard block |
||
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | - $baseSql = 'ALTER TABLE ' . $this->db->quoteTableName($table) |
|
| 379 | - . ' ALTER '. $this->db->quoteColumnName($column) |
|
| 380 | - . (($hasType)? ' TYPE ': ' ') . $this->getColumnType($type); |
|
| 378 | + $baseSql = 'ALTER TABLE ' . $this->db->quoteTableName($table) |
|
| 379 | + . ' ALTER ' . $this->db->quoteColumnName($column) |
|
| 380 | + . (($hasType) ? ' TYPE ' : ' ') . $this->getColumnType($type); |
|
| 381 | 381 | |
| 382 | 382 | if ($columnSchema->allowNull == $allowNullNewType) { |
| 383 | 383 | return $baseSql; |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $value = (int) $value; |
| 426 | 426 | } else { |
| 427 | 427 | // use master connection to get the biggest PK value |
| 428 | - $value = $this->db->useMaster(function (Connection $db) use ($tableSchema) { |
|
| 428 | + $value = $this->db->useMaster(function(Connection $db) use ($tableSchema) { |
|
| 429 | 429 | $key = false; |
| 430 | 430 | foreach ($tableSchema->primaryKey as $name) { |
| 431 | 431 | if ($tableSchema->columns[$name]->autoIncrement) { |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | break; |
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | - if($key === false){ |
|
| 436 | + if ($key === false) { |
|
| 437 | 437 | return 0; |
| 438 | 438 | } |
| 439 | 439 | return $db->createCommand("SELECT MAX({$this->db->quoteColumnName($key)}) FROM {$this->db->quoteTableName($tableSchema->name)}")->queryScalar(); |