mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Float should always be not null and default 0 in the database (from r102686)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112068 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
268800dec6
commit
322a2da0dc
@ -631,7 +631,7 @@ class MySQLDatabase extends SS_Database {
|
||||
//$parts=Array('datatype'=>'float');
|
||||
//DB::requireField($this->tableName, $this->name, "float");
|
||||
|
||||
return 'float';
|
||||
return 'float not null default ' . $values['default'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@
|
||||
class Float extends DBField {
|
||||
|
||||
function __construct($name, $defaultVal = 0) {
|
||||
$this->defaultVal = is_float($defaultVal) ? $defaultVal : (float)0;
|
||||
$this->defaultVal = is_float($defaultVal) ? $defaultVal : (float) 0;
|
||||
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user