You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doctrine\DBAL\DBALException : Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it.
at C:\xampp-php73\htdocs\blog\vendor\doctrine\dbal\lib\Doctrine\DBAL\Platforms\AbstractPlatform.php:436
432|
433| $dbType = strtolower($dbType);
434|
435| if (! isset($this->doctrineTypeMapping[$dbType])) {
> 436| throw new DBALException('Unknown database type ' . $dbType . ' requested, ' . static::class . ' may not support it.');
437| }
438|
439| return $this->doctrineTypeMapping[$dbType];
440| }
Exception trace:
1 Doctrine\DBAL\Platforms\AbstractPlatform::getDoctrineTypeMapping("enum")
C:\xampp-php73\htdocs\blog\vendor\doctrine\dbal\lib\Doctrine\DBAL\Schema\MySqlSchemaManager.php:128
2 Doctrine\DBAL\Schema\MySqlSchemaManager::_getPortableTableColumnDefinition()
C:\xampp-php73\htdocs\blog\vendor\doctrine\dbal\lib\Doctrine\DBAL\Schema\AbstractSchemaManager.php:810
Please use the argument -v to see more details.
Current behavior
when you have enum type on field, this error appear.
How to reproduce
Create new migration php artisan make:migration and fill the migration with script bellow:
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddColumnsToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasColumn('users', 'gender')) {
Schema::table('users', function (Blueprint $table) {
$table->enum('gender', ['male', 'female'])->change();
});
}
elseif ( ! Schema::hasColumn('users', 'gender')) {
Schema::table('users', function (Blueprint $table) {
$table->enum('gender', ['male', 'female']);
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}
Expected behavior
it should run normally
The text was updated successfully, but these errors were encountered:
Hello, i am also having some trouble with doctrine & enum type.
I used the second solution of the cookbook, it applied successfully but now if I want to make another migration, I am also getting the error "Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it."
But my EnumType should handle it, isn't it ?
My app's dependencies ares up-to-date.
My DBMS is maria DB 10.1.44 and unser doctrine.dbal config, I added
Bug Report
Summary
When i run
php artisan migrate
, i got this error.Current behavior
when you have enum type on field, this error appear.
How to reproduce
Create new migration
php artisan make:migration
and fill the migration with script bellow:Expected behavior
it should run normally
The text was updated successfully, but these errors were encountered: