| @@ 493-504 (lines=12) @@ | ||
| 490 | * @param string $columnType column type added |
|
| 491 | * @return string |
|
| 492 | */ |
|
| 493 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 494 | { |
|
| 495 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 496 | $default = $this->getConnection()->quote($default); |
|
| 497 | } elseif (is_bool($default)) { |
|
| 498 | $default = $this->castToBool($default); |
|
| 499 | } elseif ($default !== null && $columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 500 | $default = $this->castToBool((bool)$default); |
|
| 501 | } |
|
| 502 | ||
| 503 | return isset($default) ? " DEFAULT $default" : ''; |
|
| 504 | } |
|
| 505 | ||
| 506 | /** |
|
| 507 | * Executes all the ALTER TABLE instructions passed for the given table |
|
| @@ 969-980 (lines=12) @@ | ||
| 966 | * @param string $columnType column type added |
|
| 967 | * @return string |
|
| 968 | */ |
|
| 969 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 970 | { |
|
| 971 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 972 | $default = $this->getConnection()->quote($default); |
|
| 973 | } elseif (is_bool($default)) { |
|
| 974 | $default = $this->castToBool($default); |
|
| 975 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 976 | $default = $this->castToBool((bool)$default); |
|
| 977 | } |
|
| 978 | ||
| 979 | return isset($default) ? 'DEFAULT ' . $default : ''; |
|
| 980 | } |
|
| 981 | ||
| 982 | /** |
|
| 983 | * Gets the PostgreSQL Column Definition for a Column object. |
|