src/Phinx/Db/Adapter/MysqlAdapter.php 1 location
|
@@ 383-391 (lines=9) @@
|
| 380 |
|
* @param mixed $default |
| 381 |
|
* @return string |
| 382 |
|
*/ |
| 383 |
|
protected function getDefaultValueDefinition($default) |
| 384 |
|
{ |
| 385 |
|
if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
| 386 |
|
$default = $this->getConnection()->quote($default); |
| 387 |
|
} elseif (is_bool($default)) { |
| 388 |
|
$default = $this->castToBool($default); |
| 389 |
|
} |
| 390 |
|
return isset($default) ? ' DEFAULT ' . $default : ''; |
| 391 |
|
} |
| 392 |
|
|
| 393 |
|
/** |
| 394 |
|
* {@inheritdoc} |
src/Phinx/Db/Adapter/SQLiteAdapter.php 1 location
|
@@ 975-983 (lines=9) @@
|
| 972 |
|
* @param mixed $default |
| 973 |
|
* @return string |
| 974 |
|
*/ |
| 975 |
|
protected function getDefaultValueDefinition($default) |
| 976 |
|
{ |
| 977 |
|
if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
| 978 |
|
$default = $this->getConnection()->quote($default); |
| 979 |
|
} elseif (is_bool($default)) { |
| 980 |
|
$default = $this->castToBool($default); |
| 981 |
|
} |
| 982 |
|
return isset($default) ? ' DEFAULT ' . $default : ''; |
| 983 |
|
} |
| 984 |
|
|
| 985 |
|
/** |
| 986 |
|
* Gets the SQLite Column Definition for a Column object. |
src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location
|
@@ 1012-1020 (lines=9) @@
|
| 1009 |
|
* @param mixed $default |
| 1010 |
|
* @return string |
| 1011 |
|
*/ |
| 1012 |
|
protected function getDefaultValueDefinition($default) |
| 1013 |
|
{ |
| 1014 |
|
if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
| 1015 |
|
$default = $this->getConnection()->quote($default); |
| 1016 |
|
} elseif (is_bool($default)) { |
| 1017 |
|
$default = $this->castToBool($default); |
| 1018 |
|
} |
| 1019 |
|
return isset($default) ? ' DEFAULT ' . $default : ''; |
| 1020 |
|
} |
| 1021 |
|
|
| 1022 |
|
/** |
| 1023 |
|
* Gets the SqlServer Column Definition for a Column object. |
src/Phinx/Db/Adapter/PostgresAdapter.php 1 location
|
@@ 909-917 (lines=9) @@
|
| 906 |
|
* @param mixed $default |
| 907 |
|
* @return string |
| 908 |
|
*/ |
| 909 |
|
protected function getDefaultValueDefinition($default) |
| 910 |
|
{ |
| 911 |
|
if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) { |
| 912 |
|
$default = $this->getConnection()->quote($default); |
| 913 |
|
} elseif (is_bool($default)) { |
| 914 |
|
$default = $this->castToBool($default); |
| 915 |
|
} |
| 916 |
|
return isset($default) ? 'DEFAULT ' . $default : ''; |
| 917 |
|
} |
| 918 |
|
|
| 919 |
|
/** |
| 920 |
|
* Gets the PostgreSQL Column Definition for a Column object. |