From 3d6a492e9365096a3d749dbcabc97ee4b65c75c5 Mon Sep 17 00:00:00 2001 From: Hayden Smith Date: Tue, 13 Jan 2009 03:56:25 +0000 Subject: [PATCH] API CHANGE: Decimal->requireField now includes 'not null' constraint, as Sapphire doesn't expect the value to be null. MySQL switches null values to 0.00 on build. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70057 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/fieldtypes/Decimal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/fieldtypes/Decimal.php b/core/model/fieldtypes/Decimal.php index 5b4b1630e..488e3b2ac 100644 --- a/core/model/fieldtypes/Decimal.php +++ b/core/model/fieldtypes/Decimal.php @@ -25,7 +25,7 @@ class Decimal extends DBField { } function requireField() { - DB::requireField($this->tableName, $this->name, "decimal($this->wholeSize,$this->decimalSize)"); + DB::requireField($this->tableName, $this->name, "decimal($this->wholeSize,$this->decimalSize) not null"); } function saveInto($dataObject) {