Builder plugin error 'Unknown database type uuid requested...'

I am not sure if the latest update to v4.1.13 has caused the issue or something else. Suddenly, if I try to use anything related to database access in builder, I get following error:

Unknown database type uuid requested, Doctrine\DBAL\Platforms\MariaDb110700Platform may not support it.

I have updated several websites without issues. Just one of them doesn’t allow me to access the database.

@omninet Register a type mapping so Doctrine treats uuid as string.

Add this in a Service Provider or Plugin boot method:

use Illuminate\Support\Facades\DB;

public function boot()
{
    DB::connection()->getDoctrineSchemaManager()
        ->getDatabasePlatform()
        ->registerDoctrineTypeMapping('uuid', 'string');
}

If this is OctoberCMS, place it in:

plugins/yourvendor/yourplugin/Plugin.php

Inside boot().

This tells Doctrine:

When you see uuid, treat it as a string.

No database changes required.