chore
This commit is contained in:
parent
e3dd4ee86c
commit
527aca2250
@ -56,7 +56,7 @@ class Schemas extends CatchModel
|
|||||||
'columns' => implode(',', array_column($structures, 'field')),
|
'columns' => implode(',', array_column($structures, 'field')),
|
||||||
|
|
||||||
'is_soft_delete' => $schema['deleted_at'] ? Status::Enable : Status::Disable
|
'is_soft_delete' => $schema['deleted_at'] ? Status::Enable : Status::Disable
|
||||||
]);
|
], true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$schemaCreate = new Schema($schema['name'], $schema['engine'], $schema['charset'], $schema['collection'], $schema['comment']);
|
$schemaCreate = new Schema($schema['name'], $schema['engine'], $schema['charset'], $schema['collection'], $schema['comment']);
|
||||||
|
@ -207,7 +207,9 @@ class Schema extends Creator
|
|||||||
->when($structure['nullable'], function ($str) {
|
->when($structure['nullable'], function ($str) {
|
||||||
return $str->append('->nullable()');
|
return $str->append('->nullable()');
|
||||||
})
|
})
|
||||||
->when(isset($structure['default']), function ($str, $default) {
|
->when(isset($structure['default']), function ($str) use ($structure){
|
||||||
|
$default = $structure['default'];
|
||||||
|
|
||||||
if (is_numeric($default)) {
|
if (is_numeric($default)) {
|
||||||
$default = intval($default);
|
$default = intval($default);
|
||||||
return $str->append("->default({$default})");
|
return $str->append("->default({$default})");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user