Skip to content

Commit b709f40

Browse files
committed
fix: fix int(11) for mysql
1 parent ad10660 commit b709f40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Resolvers/SchemaRulesResolverMySql.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ protected function generateColumnRules(stdClass $column): array
9090
$columnRules[] = "integer";
9191
$sign = ($type->contains('unsigned')) ? 'unsigned' : 'signed' ;
9292
$intType = $type->before(' unsigned')->__toString();
93+
94+
// prevent int(xx) for mysql
95+
if(!array_key_exists($intType, self::$integerTypes)){
96+
$intType = "int";
97+
}
98+
9399
$columnRules[] = "min:".self::$integerTypes[$intType][$sign][0];
94100
$columnRules[] = "max:".self::$integerTypes[$intType][$sign][1];
95101

0 commit comments

Comments
 (0)