我试图在 laraval 5.8 中使用 php artisan migrate 命令更改我的 char 类型列默认值,但出现以下错误:Unknown column type "char" 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.我当前的脚本如下:use Illuminate\Support\Facades\Schema;use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;class AddTypeDeafultValueProjectsTable extends Migration{/** * Run the migrations. * * @return void */public function up(){ Schema::table('projects', function (Blueprint $table) { $table->char('type', 50)->nullable(true)->change(); });}/** * Reverse the migrations. * * @return void */public function down(){ Schema::table('projects', function (Blueprint $table) { // });}}我没有遇到其他数据类型列的问题,但仅针对 char 出现上述错误。可以帮我解决这个问题吗?
1 回答
慕仙森
TA贡献1827条经验 获得超7个赞
$message = rawurlencode('This is your message');
// Prepare data for POST request
$data = "futherurldata";
// Send the GET request with cURL
$ch = curl_init('http://login.xyz.com/api/mt/SendSMS?' . $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// Process your response here
echo $response;
- 1 回答
- 0 关注
- 83 浏览
添加回答
举报
0/150
提交
取消