BUG 6691 Do not allow default values for text

This commit is contained in:
Alexandre Rosenfeld
2011-04-29 12:24:43 -04:00
parent af1ca150cb
commit 8c07bad50b

View File

@@ -740,6 +740,8 @@ class Column extends XMLElement {
$dflt = "";
if ($this->getDefaultValue() !== null) {
$dflt .= "default ";
if ($this->getType() == "LONGVARCHAR")
throw new Exception("ERROR: Text cannot have default value (column: '{$this->name}', type: '{$this->getType()}', default: '{$this->getDefaultValue()}')");
if (PropelTypes::isTextType($this->getType())) {
$dflt .= '\'' . $this->getPlatform()->escapeText($this->getDefaultValue()) . '\'';
} elseif ($this->getType() == PropelTypes::BOOLEAN) {