File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Columns Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -106,17 +106,16 @@ public function fromDefinition(array $data)
106106 {
107107 $ matches = [];
108108 if (preg_match (
109- '/^(?<type>big|small|tiny|medium)?int( \((?<padding>\d+)\))* / ' ,
109+ '/^(?<type>(?: big|small|tiny|medium)?int)(?: \((?<padding>\d+)\))? / ' ,
110110 $ data ['definition ' ],
111111 $ matches
112112 )) {
113- /**
114- * match[1] - prefix
115- * match[2] - padding with beaked, like (5) or (11)
116- * match[3] - padding, like 5 or 11
117- */
118- if (count ($ matches ) >= 4 ) {
119- //Use shortcut for mediuminteger
113+ $ data ['padding ' ] = null ;
114+ // we have an agreement that tinyint(1) is Boolean
115+ if (isset ($ matches ['padding ' ])
116+ && $ matches ['type ' ] === 'tinyint '
117+ && $ matches ['padding ' ] === '1 '
118+ ) {
120119 $ data ['padding ' ] = $ matches ['padding ' ];
121120 }
122121 $ data = $ this ->unsigned ->fromDefinition ($ data );
You can’t perform that action at this time.
0 commit comments