File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,21 @@ public function getPhpType() : string
49
49
50
50
public function getPhpCode () : string
51
51
{
52
+ $ default = '' ;
53
+
54
+ if ($ this ->hasDefault ()) {
55
+ $ default = '->setDefault( '
56
+ . ($ this ->getDefault () === null
57
+ ? 'null '
58
+ : '\'' . $ this ->getDefault () . '\'' )
59
+ . ') ' ;
60
+ }
61
+
52
62
return '(new \\' . static ::class . '( '
53
63
. $ this ->precision
54
64
. ', ' . $ this ->scale
55
65
. ')) '
56
- . ( $ this -> hasDefault () ? ' ->setDefault( \'' . $ this -> getDefault () . '\' ) ' : '' )
66
+ . $ default
57
67
. $ this ->getNullablePhp ();
58
68
}
59
69
}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ CREATE TABLE `transactions` (
46
46
` id` int (10 ) NOT NULL AUTO_INCREMENT,
47
47
` total` DECIMAL (12 , 2 ) NOT NULL ,
48
48
` tax` DECIMAL (12 , 2 ) NOT NULL ,
49
+ ` other_tax` DECIMAL (12 , 2 ) DEFAULT NULL ,
49
50
PRIMARY KEY (` id` )
50
51
)
51
52
ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
You can’t perform that action at this time.
0 commit comments