| @@ 495-506 (lines=12) @@ | ||
| 492 | * @param string $columnType column type added |
|
| 493 | * @return string |
|
| 494 | */ |
|
| 495 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 496 | { |
|
| 497 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 498 | $default = $this->getConnection()->quote($default); |
|
| 499 | } elseif (is_bool($default)) { |
|
| 500 | $default = $this->castToBool($default); |
|
| 501 | } elseif ($default !== null && $columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 502 | $default = $this->castToBool((bool)$default); |
|
| 503 | } |
|
| 504 | ||
| 505 | return isset($default) ? " DEFAULT $default" : ''; |
|
| 506 | } |
|
| 507 | ||
| 508 | /** |
|
| 509 | * Executes all the ALTER TABLE instructions passed for the given table |
|
| @@ 1090-1101 (lines=12) @@ | ||
| 1087 | * @param string $columnType column type added |
|
| 1088 | * @return string |
|
| 1089 | */ |
|
| 1090 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 1091 | { |
|
| 1092 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 1093 | $default = $this->getConnection()->quote($default); |
|
| 1094 | } elseif (is_bool($default)) { |
|
| 1095 | $default = $this->castToBool($default); |
|
| 1096 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 1097 | $default = $this->castToBool((bool)$default); |
|
| 1098 | } |
|
| 1099 | ||
| 1100 | return isset($default) ? 'DEFAULT ' . $default : ''; |
|
| 1101 | } |
|
| 1102 | ||
| 1103 | /** |
|
| 1104 | * Gets the PostgreSQL Column Definition for a Column object. |
|