@@ 467-478 (lines=12) @@ | ||
464 | * @param string $columnType column type added |
|
465 | * @return string |
|
466 | */ |
|
467 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
468 | { |
|
469 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
470 | $default = $this->getConnection()->quote($default); |
|
471 | } elseif (is_bool($default)) { |
|
472 | $default = $this->castToBool($default); |
|
473 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
474 | $default = $this->castToBool((bool)$default); |
|
475 | } |
|
476 | ||
477 | return isset($default) ? " DEFAULT $default" : ''; |
|
478 | } |
|
479 | ||
480 | /** |
|
481 | * Executes all the ALTER TABLE instructions passed for the given table |
@@ 956-967 (lines=12) @@ | ||
953 | * @param string $columnType column type added |
|
954 | * @return string |
|
955 | */ |
|
956 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
957 | { |
|
958 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
959 | $default = $this->getConnection()->quote($default); |
|
960 | } elseif (is_bool($default)) { |
|
961 | $default = $this->castToBool($default); |
|
962 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
963 | $default = $this->castToBool((bool)$default); |
|
964 | } |
|
965 | ||
966 | return isset($default) ? 'DEFAULT ' . $default : ''; |
|
967 | } |
|
968 | ||
969 | /** |
|
970 | * Gets the PostgreSQL Column Definition for a Column object. |