| @@ 436-447 (lines=12) @@ | ||
| 433 | * @param string $columnType column type added |
|
| 434 | * @return string |
|
| 435 | */ |
|
| 436 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 437 | { |
|
| 438 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 439 | $default = $this->getConnection()->quote($default); |
|
| 440 | } elseif (is_bool($default)) { |
|
| 441 | $default = $this->castToBool($default); |
|
| 442 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 443 | $default = $this->castToBool((bool)$default); |
|
| 444 | } |
|
| 445 | ||
| 446 | return isset($default) ? " DEFAULT $default" : ''; |
|
| 447 | } |
|
| 448 | } |
|
| 449 | ||
| @@ 954-965 (lines=12) @@ | ||
| 951 | * @param string $columnType column type added |
|
| 952 | * @return string |
|
| 953 | */ |
|
| 954 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 955 | { |
|
| 956 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 957 | $default = $this->getConnection()->quote($default); |
|
| 958 | } elseif (is_bool($default)) { |
|
| 959 | $default = $this->castToBool($default); |
|
| 960 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 961 | $default = $this->castToBool((bool)$default); |
|
| 962 | } |
|
| 963 | ||
| 964 | return isset($default) ? 'DEFAULT ' . $default : ''; |
|
| 965 | } |
|
| 966 | ||
| 967 | /** |
|
| 968 | * Gets the PostgreSQL Column Definition for a Column object. |
|