File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 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
4949
5050 public function getPhpCode () : string
5151 {
52+ $ default = '' ;
53+
54+ if ($ this ->hasDefault ()) {
55+ $ default = '->setDefault( '
56+ . ($ this ->getDefault () === null
57+ ? 'null '
58+ : '\'' . $ this ->getDefault () . '\'' )
59+ . ') ' ;
60+ }
61+
5262 return '(new \\' . static ::class . '( '
5363 . $ this ->precision
5464 . ', ' . $ this ->scale
5565 . ')) '
56- . ( $ this -> hasDefault () ? ' ->setDefault( \'' . $ this -> getDefault () . '\' ) ' : '' )
66+ . $ default
5767 . $ this ->getNullablePhp ();
5868 }
5969}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ CREATE TABLE `transactions` (
4646 ` id` int (10 ) NOT NULL AUTO_INCREMENT,
4747 ` total` DECIMAL (12 , 2 ) NOT NULL ,
4848 ` tax` DECIMAL (12 , 2 ) NOT NULL ,
49+ ` other_tax` DECIMAL (12 , 2 ) DEFAULT NULL ,
4950 PRIMARY KEY (` id` )
5051)
5152ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
You can’t perform that action at this time.
0 commit comments