1. Currently, the theme_id field in the theme_asset table has a type of varchar(255). The previous migration code is as follows. See Figure 1.

PHP
$table->string('theme_id')->nullable(false)->comment('主题Id');
2. Now I plan to add a new migration file to change the type of the theme_id field to: uuid, which is char(36).
PHP
$table->uuid('theme_id')->change();
3. Error: Doctrine\DBAL\Exception : Unknown column type “uuid” requested. See Figure 2.

Plaintext
PS E:\wwwroot\object> php artisan module:migrate ThemeStoreDB
Migrating: 2022_05_20_160818_update_theme_asset_table
Doctrine\DBAL\Exception : Unknown column type "uuid" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgotten to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information.
at E:\wwwroot\object\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php:282
278| * @return Exception
279| */
280| public static function unknownColumnType($name)
281| {
> 282| return new Exception('Unknown column type "' . $name . '" requested. Any Doctrine type that you use has ' .
283| 'to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the ' .
284| 'known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database ' .
285| 'introspection then you might have forgotten to register all database types for a Doctrine Type. Use ' .
286| 'AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement ' .
Exception trace:
1 Doctrine\DBAL\DBALException::unknownColumnType("uuid")
E:\wwwroot\object\vendor\doctrine\dbal\lib\Doctrine\DBAL\Types\TypeRegistry.php:37
2 Doctrine\DBAL\Types\TypeRegistry::get("uuid")
E:\wwwroot\object\vendor\doctrine\dbal\lib\Doctrine\DBAL\Types\Type.php:237
Please use the argument -v to see more details.
4. After changing it to char, the error still occurs: Unknown column type “char” requested.
PHP
$table->char('theme_id', 36)->change();
5. I finally decided to use DB::statement. The code is as follows:
PHP
DB::statement('ALTER TABLE ' . DB::connection()->getTablePrefix() . 'theme_asset MODIFY theme_id char(36) NOT NULL COMMENT \'文件内容\'');
6. I checked and compared the SQL for generating the table, and it meets expectations. See Figure 3.

SQL
`theme_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '主题Id',
`theme_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '主题Id',
