InfyOmLabs/laravel-generator

Migration ganeration, if dbType does not include ":".

msksbt opened this issue · 2 comments

Hi, thanks for this awesome project.
( I'm sorry if there are any grammatical mistakes. )

I generated migration from JSON, but it's maked wrong statement.

I tried this:

{
..
    "name": "field_name",
    "dbType": "char,26",
..
}

but, it maked this:

    $table->char,26('field_name');

I think that the problem occurs if dbType does not include ':', and there is a problem in follow clode block,
I tried this block to commented out, then the problem seems to be resolved.

if (!Str::contains($dbInput, ':')) {
$this->dbType = $dbInput;
$this->prepareMigrationText();
return;
}

Thanks.

@msksbt Good Catch. Feel free to put a PR if you can, or I will take care of it by this week.

@mitulgolakiya OK. I will try to fix and PR. thanks.