| @@ 1080-1091 (lines=12) @@ | ||
| 1077 | * @param string $columnType column type added |
|
| 1078 | * @return string |
|
| 1079 | */ |
|
| 1080 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 1081 | { |
|
| 1082 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 1083 | $default = $this->getConnection()->quote($default); |
|
| 1084 | } elseif (is_bool($default)) { |
|
| 1085 | $default = $this->castToBool($default); |
|
| 1086 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 1087 | $default = $this->castToBool((bool)$default); |
|
| 1088 | } |
|
| 1089 | ||
| 1090 | return isset($default) ? 'DEFAULT ' . $default : ''; |
|
| 1091 | } |
|
| 1092 | ||
| 1093 | /** |
|
| 1094 | * Gets the PostgreSQL Column Definition for a Column object. |
|
| @@ 508-519 (lines=12) @@ | ||
| 505 | * @param string $columnType column type added |
|
| 506 | * @return string |
|
| 507 | */ |
|
| 508 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 509 | { |
|
| 510 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 511 | $default = $this->getConnection()->quote($default); |
|
| 512 | } elseif (is_bool($default)) { |
|
| 513 | $default = $this->castToBool($default); |
|
| 514 | } elseif ($default !== null && $columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 515 | $default = $this->castToBool((bool)$default); |
|
| 516 | } |
|
| 517 | ||
| 518 | return isset($default) ? " DEFAULT $default" : ''; |
|
| 519 | } |
|
| 520 | ||
| 521 | /** |
|
| 522 | * Executes all the ALTER TABLE instructions passed for the given table |
|