From 29afa282b9a9801865f5192a2b5fdda5a9341453 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 7 May 2009 05:58:10 +0000 Subject: [PATCH] BUGFIX: Added default values for Money's component fields, to work with more picky databases. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76368 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/fieldtypes/Money.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/model/fieldtypes/Money.php b/core/model/fieldtypes/Money.php index 0bdda0b27..ce013b9f1 100644 --- a/core/model/fieldtypes/Money.php +++ b/core/model/fieldtypes/Money.php @@ -60,8 +60,8 @@ class Money extends DBField implements CompositeDBField { * @param array */ static $composite_db = array( - "Currency" => "Varchar(3)", - "Amount" => "Decimal(14,2)", + "Currency" => "Varchar(3) null", + "Amount" => Array('type'=>'decimal', 'parts'=>Array('datatype'=>'decimal', 'precision'=>"14,2"), 'default' => '0'), ); function __construct($name = null) {