Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it. #50

Closed
cod3rshotout opened this issue Jan 28, 2022 · 2 comments

Comments

@cod3rshotout
Copy link

Hi,

I have created a migration like this:

Schema::create('riskareas_fields', function (Blueprint $table) {
    $table->id();
    $table->string('name');
    $table->enum('type', ['number', 'min_max', 'text']);
    $table->string('icon')->nullable();
    $table->timestamps();
    $table->softDeletes();
});

then I've defined the model

class RiskareasField extends Model
{
    protected $table = "riskareas_fields";
    protected $fillable = [
        'name',
        'type',
        'icon'
    ];
}

I tried to create a datatable using the boilerplate command: php artisan boilerplate:datatable riskareasfields --model="App\Models\RiskareasField but I get:

Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it.

I'm using Laravel 8 and php 8.0.2

@sebastienheyd
Copy link
Owner

sebastienheyd commented Jan 28, 2022

Hi,

enum is not supported by Doctrine, and I use Doctrine to get the field name and type to set the correct type and filter to use.

You can use the --nodb option to avoid using Doctrine when calling the artisan command or set string type instead of enum, see the documentation.

I must see if I can avoid the exception and setting a default type when meeting an enum

@cod3rshotout
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants