Search
 
SCRIPT & CODE EXAMPLE
 

PHP

[DoctrineDBALDBALException]Unknown database type enum requested, DoctrineDBALPlatformsMySqlPlatform may not support it.

It is a known issue as stated in Laravel 5.1 documentation.

    Note: Renaming columns in a table with a enum column is not currently supported.

It happens when you have a enum column in your database table. Whether you are trying to rename another column, or change another column to nullable, this bug will appear. It's an issue with DoctrineDBAL.

An easy fix for this is to just add this constructor method in your database migration file.

public function __construct()
{
    DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
}

This will map all the ENUM columns to VARCHAR(), and the column will accept any string.

    This worked for me on Laravel 5.1 and Laravel 5.3. I hope this bug can be fixed soon.

Credit to @Gmatkowski's answer at https://stackoverflow.com/a/32860409/1193201
Comment

Unknown database type enum requested, DoctrineDBALPlatformsMySQL57Platfo rm may not support it.

DB::connection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
Comment

PREVIOUS NEXT
Code Example
Php :: Array and string offset access syntax with curly braces is deprecated in tcpdf.php 
Php :: php empty 
Php :: wp get category by id 
Php :: foreignid in laravel 
Php :: php to call javascript function 
Php :: laravel file size validation 
Php :: laravel created_at where date format 
Php :: round numnero php 
Php :: php 2d empty array remove 
Php :: PHP executable not found. Install PHP and add it to your PATH or set the php.executablePath setting in linux 
Php :: how to show validation error in laravel 8 
Php :: eloquent get distinct 
Php :: How do I make a redirect in PHP? 
Php :: php http_build_query 
Php :: serve in localhost using php 
Php :: laravel route resources 
Php :: php artisan storage link cpanel 
Php :: magento 2 print php error 
Php :: laravel loop counter 
Php :: array_last in laravel 8 
Php :: separate date from datetime php 
Php :: minus 1 year php 
Php :: php token generator 
Php :: php failed to open stream: Permission denied iis 
Php :: How to format a json response in php 
Php :: ::update() should not be called statically 
Php :: var dump php look clear 
Php :: Laravel randomise data from database 
Php :: php datum formatieren 
Php :: item count in cart quantitiy woocommerce 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =