File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,13 +66,14 @@ protected function analyseColumns(Table $table): void
6666 $ column ->setName ($ col ['name ' ]);
6767 $ column ->setNullable ($ col ['nullable ' ]);
6868 $ column ->setType (Helpers::columnType ($ col ['nativetype ' ]));
69- $ column ->setDefault ($ col ['default ' ]);
69+ $ column ->setDefault (is_scalar ( $ col ['default ' ]) ? ( string ) $ col [ ' default ' ] : null );
7070 $ column ->setOnUpdate (str_contains ($ col ['vendor ' ]['extra ' ] ?? $ col ['vendor ' ]['Extra ' ] ?? '' , 'on update ' ));
7171
7272 // Analyse ENUM
7373 if ($ col ['nativetype ' ] === ColumnTypes::NATIVE_TYPE_ENUM ) {
74+ /** @var array<int, array<int, string>> $enum */
7475 $ enum = Strings::matchAll ($ col ['vendor ' ]['type ' ] ?? $ col ['vendor ' ]['Type ' ], ColumnTypes::NATIVE_REGEX_ENUM , PREG_PATTERN_ORDER );
75- if ($ enum !== [] ) {
76+ if (isset ( $ enum[ 1 ]) ) {
7677 $ column ->setEnum ($ enum [1 ]);
7778 $ column ->setType (ColumnTypes::TYPE_ENUM );
7879 $ column ->setSubtype (Helpers::columnType ($ col ['nativetype ' ]));
You can’t perform that action at this time.
0 commit comments