$column->autoIncrement($data['autoIncrement'] ?: null);
}
+ if ($column instanceof ILengthDatabaseTableColumn) {
+ $column->length($data['length'] ?: null);
+ }
+
if ($column instanceof IDecimalsDatabaseTableColumn) {
$column->decimals($data['decimals'] ?: null);
}
$column->enumValues($values);
}
- if ($column instanceof ILengthDatabaseTableColumn) {
- $column->length($data['length'] ?: null);
- }
-
return $column;
}
}
*/
protected $type = 'decimal';
+ /**
+ * @inheritDoc
+ */
+ public function decimals($decimals) {
+ if ($this->getLength() === null) {
+ throw new \BadMethodCallException("Before setting the decimals, the length has to be set.");
+ }
+
+ return parent::decimals($decimals);
+ }
+
/**
* @inheritDoc
*/