This commit is contained in:
Juan Pablo Vial
2024-12-18 19:56:26 -03:00
parent d6b735f2aa
commit 46cdf74c52

View File

@ -176,7 +176,10 @@ class ColumnParser
foreach ($validOptions as $validOption => $callable) {
if (str_contains(strtolower($this->line), $validOption)) {
list($option, $value) = $callable($parts);
if (!is_bool($value) and !ctype_digit($value)) {
if (strtolower($value) === 'null') {
$value = 'null';
}
if ($value !== 'null' and !is_bool($value) and !ctype_digit($value)) {
$value = trim($value, "'");
$value = "'{$value}'";
}
@ -490,7 +493,10 @@ use Phinx\Seed\AbstractSeed;
if (is_bool($value)) {
$value = $value ? 1 : 0;
}
if (!ctype_digit("{$value}")) {
if (!ctype_digit("{$value}") and $value !== null) {
if (str_contains($value, "'")) {
$value = str_replace("'", "\'", $value);
}
$value = "'{$value}'";
}
$output []= "\t\t\t\t'{$key}' => {$value},";