| @@ 494-505 (lines=12) @@ | ||
| 491 | * @param string $columnType column type added |
|
| 492 | * @return string |
|
| 493 | */ |
|
| 494 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 495 | { |
|
| 496 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 497 | $default = $this->getConnection()->quote($default); |
|
| 498 | } elseif (is_bool($default)) { |
|
| 499 | $default = $this->castToBool($default); |
|
| 500 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 501 | $default = $this->castToBool((bool)$default); |
|
| 502 | } |
|
| 503 | ||
| 504 | return isset($default) ? " DEFAULT $default" : ''; |
|
| 505 | } |
|
| 506 | ||
| 507 | /** |
|
| 508 | * Executes all the ALTER TABLE instructions passed for the given table |
|
| @@ 1114-1125 (lines=12) @@ | ||
| 1111 | * @param string $columnType column type added |
|
| 1112 | * @return string |
|
| 1113 | */ |
|
| 1114 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 1115 | { |
|
| 1116 | if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
|
| 1117 | $default = $this->getConnection()->quote($default); |
|
| 1118 | } elseif (is_bool($default)) { |
|
| 1119 | $default = $this->castToBool($default); |
|
| 1120 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 1121 | $default = $this->castToBool((bool)$default); |
|
| 1122 | } |
|
| 1123 | ||
| 1124 | return isset($default) ? 'DEFAULT ' . $default : ''; |
|
| 1125 | } |
|
| 1126 | ||
| 1127 | /** |
|
| 1128 | * Gets the PostgreSQL Column Definition for a Column object. |
|