| @@ 584-595 (lines=12) @@ | ||
| 581 | * |
|
| 582 | * @return string |
|
| 583 | */ |
|
| 584 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 585 | { |
|
| 586 | if (is_string($default) && $default !== 'CURRENT_TIMESTAMP') { |
|
| 587 | $default = $this->getConnection()->quote($default); |
|
| 588 | } elseif (is_bool($default)) { |
|
| 589 | $default = $this->castToBool($default); |
|
| 590 | } elseif ($default !== null && $columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 591 | $default = $this->castToBool((bool)$default); |
|
| 592 | } |
|
| 593 | ||
| 594 | return isset($default) ? " DEFAULT $default" : ''; |
|
| 595 | } |
|
| 596 | ||
| 597 | /** |
|
| 598 | * Executes all the ALTER TABLE instructions passed for the given table |
|
| @@ 1108-1119 (lines=12) @@ | ||
| 1105 | * |
|
| 1106 | * @return string |
|
| 1107 | */ |
|
| 1108 | protected function getDefaultValueDefinition($default, $columnType = null) |
|
| 1109 | { |
|
| 1110 | if (is_string($default) && $default !== 'CURRENT_TIMESTAMP') { |
|
| 1111 | $default = $this->getConnection()->quote($default); |
|
| 1112 | } elseif (is_bool($default)) { |
|
| 1113 | $default = $this->castToBool($default); |
|
| 1114 | } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) { |
|
| 1115 | $default = $this->castToBool((bool)$default); |
|
| 1116 | } |
|
| 1117 | ||
| 1118 | return isset($default) ? 'DEFAULT ' . $default : ''; |
|
| 1119 | } |
|
| 1120 | ||
| 1121 | /** |
|
| 1122 | * Gets the PostgreSQL Column Definition for a Column object. |
|