mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: modified float to have the same database table schema as int. Now defaults to zero and 'not null'
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98847 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e5666748f6
commit
d5fe2733e0
@ -6,8 +6,14 @@
|
||||
*/
|
||||
class Float extends DBField {
|
||||
|
||||
function __construct($name, $defaultVal = 0) {
|
||||
$this->defaultVal = is_float($defaultVal) ? $defaultVal : (float)0;
|
||||
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
||||
function requireField() {
|
||||
$parts=Array('datatype'=>'float', 'arrayValue'=>$this->arrayValue);
|
||||
$parts=Array('datatype'=>'float', 'null'=>'not null', 'default'=>$this->defaultVal, 'arrayValue'=>$this->arrayValue);
|
||||
$values=Array('type'=>'float', 'parts'=>$parts);
|
||||
DB::requireField($this->tableName, $this->name, $values);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user