Commit 64f7e3a3 authored by zYne's avatar zYne

added default lengths for all data types

parent b2e6bbb2
......@@ -700,14 +700,32 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
}
if ($length == null &&
($type === 'string' ||
$type === 'clob' ||
$type === 'integer' ||
$type === 'blob' ||
$type === 'gzip')) {
if ($length == null) {
switch ($type) {
case 'string':
case 'clob':
case 'integer':
case 'array':
case 'object':
case 'blob':
case 'gzip':
// use php int max
$length = 2147483647;
break;
case 'boolean':
$length = 1;
case 'date':
// YYYY-MM-DD ISO 8601
$length = 10;
case 'time':
// HH:NN:SS+00:00 ISO 8601
$length = 14;
case 'timestamp':
// YYYY-MM-DDTHH:MM:SS+00:00 ISO 8601
$length = 25;
break;
}
}
$this->columns[$name] = $options;
......
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