Skip to content

Commit f3b3ad9

Browse files
committed
Refactor
1 parent 9e8905c commit f3b3ad9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/ColumnToCode.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,15 @@ public function getCode(bool $quoted = false):string
166166
return implode('->', array_filter(array_map('trim', $parts)));
167167
}
168168

169+
if (ApiGenerator::isPostgres() && $this->alterByXDbType) {
170+
return $quoted ? VarDumper::export($this->rawParts['type']) : $this->rawParts['type'];
171+
}
172+
169173
$default = $this->rawParts['default'] !== null ? ' DEFAULT ' . trim($this->rawParts['default']) : '';
170174
$code = $this->rawParts['type'] . ' ' . $this->rawParts['nullable'] . $default;
171175
if ((ApiGenerator::isMysql() || ApiGenerator::isMariaDb()) && $this->rawParts['position']) {
172176
$code .= ' ' . $this->rawParts['position'];
173177
}
174-
if (ApiGenerator::isPostgres() && $this->alterByXDbType) {
175-
return $quoted ? VarDumper::export($this->rawParts['type']) : $this->rawParts['type'];
176-
}
177178
return $quoted ? VarDumper::export($code) : $code;
178179
}
179180

0 commit comments

Comments
 (0)