Commit 5cd66217 authored by Benjamin Eberlei's avatar Benjamin Eberlei

DBAL-62 - There is a diference between maximum length (now 4000, oracle is the...

DBAL-62 - There is a diference between maximum length (now 4000, oracle is the smallest possible denominator here) of varchars and the default length (255).
parent e8734ad7
...@@ -245,6 +245,16 @@ abstract class AbstractPlatform ...@@ -245,6 +245,16 @@ abstract class AbstractPlatform
* @return integer * @return integer
*/ */
public function getVarcharMaxLength() public function getVarcharMaxLength()
{
return 4000;
}
/**
* Gets the default length of a varchar field.
*
* @return integer
*/
public function getVarcharDefaultLength()
{ {
return 255; return 255;
} }
......
...@@ -52,7 +52,7 @@ class DB2Platform extends AbstractPlatform ...@@ -52,7 +52,7 @@ class DB2Platform extends AbstractPlatform
{ {
if ( ! isset($field['length'])) { if ( ! isset($field['length'])) {
if (array_key_exists('default', $field)) { if (array_key_exists('default', $field)) {
$field['length'] = $this->getVarcharMaxLength(); $field['length'] = $this->getVarcharDefaultLength();
} else { } else {
$field['length'] = false; $field['length'] = false;
} }
......
...@@ -543,7 +543,7 @@ class MsSqlPlatform extends AbstractPlatform ...@@ -543,7 +543,7 @@ class MsSqlPlatform extends AbstractPlatform
{ {
if (!isset($field['length'])) { if (!isset($field['length'])) {
if (array_key_exists('default', $field)) { if (array_key_exists('default', $field)) {
$field['length'] = $this->getVarcharMaxLength(); $field['length'] = $this->getVarcharDefaultLength();
} else { } else {
$field['length'] = false; $field['length'] = false;
} }
......
...@@ -156,7 +156,7 @@ class MySqlPlatform extends AbstractPlatform ...@@ -156,7 +156,7 @@ class MySqlPlatform extends AbstractPlatform
{ {
if ( ! isset($field['length'])) { if ( ! isset($field['length'])) {
if (array_key_exists('default', $field)) { if (array_key_exists('default', $field)) {
$field['length'] = $this->getVarcharMaxLength(); $field['length'] = $this->getVarcharDefaultLength();
} else { } else {
$field['length'] = false; $field['length'] = false;
} }
......
...@@ -238,7 +238,7 @@ class OraclePlatform extends AbstractPlatform ...@@ -238,7 +238,7 @@ class OraclePlatform extends AbstractPlatform
{ {
if ( ! isset($field['length'])) { if ( ! isset($field['length'])) {
if (array_key_exists('default', $field)) { if (array_key_exists('default', $field)) {
$field['length'] = $this->getVarcharMaxLength(); $field['length'] = $this->getVarcharDefaultLength();
} else { } else {
$field['length'] = false; $field['length'] = false;
} }
......
...@@ -595,7 +595,7 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -595,7 +595,7 @@ class PostgreSqlPlatform extends AbstractPlatform
{ {
if ( ! isset($field['length'])) { if ( ! isset($field['length'])) {
if (array_key_exists('default', $field)) { if (array_key_exists('default', $field)) {
$field['length'] = $this->getVarcharMaxLength(); $field['length'] = $this->getVarcharDefaultLength();
} else { } else {
$field['length'] = false; $field['length'] = false;
} }
......
...@@ -304,7 +304,7 @@ class SqlitePlatform extends AbstractPlatform ...@@ -304,7 +304,7 @@ class SqlitePlatform extends AbstractPlatform
{ {
if ( ! isset($field['length'])) { if ( ! isset($field['length'])) {
if (array_key_exists('default', $field)) { if (array_key_exists('default', $field)) {
$field['length'] = $this->getVarcharMaxLength(); $field['length'] = $this->getVarcharDefaultLength();
} else { } else {
$field['length'] = false; $field['length'] = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment