Skip to content

Commit 2026a97

Browse files
committed
:octocat: QueryBuilder: fix USER_DEFINED type
1 parent 35a0bbb commit 2026a97

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Query/QueryBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ public function primaryKey(string $field, string $dir = null):CreateTable{
157157

158158
/** @inheritdoc */
159159
public function field(string $name, string $type, $length = null, string $attribute = null, string $collation = null, bool $isNull = null, string $defaultType = null, $defaultValue = null, string $extra = null):CreateTable{
160+
161+
if(is_scalar($defaultValue) && $defaultType !== null){
162+
$defaultType = 'USER_DEFINED';
163+
}
164+
160165
$this->cols[$name] = $this->dialect->fieldspec($name, $type, $length, $attribute, $collation, $isNull, $defaultType, $defaultValue, $extra);
161166

162167
return $this;

0 commit comments

Comments
 (0)