第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Laravel 5.8 在“char”類型列遷移時(shí)出錯(cuò)

Laravel 5.8 在“char”類型列遷移時(shí)出錯(cuò)

PHP
倚天杖 2023-03-11 15:03:44
你的觀點(diǎn)是混亂的。首先添加表單操作然后添加按鈕表單屬性,如下所示:<button type="submit" form="upload" class="btn btn-info pull-right" id="submit" data-loading-text='SOME TEXT'> Please wait<?php echo $this->lang->line('save'); ?></button><form id="upload" role="form" method="post" class="ptt10" enctype="multipart/form-data" action="upload_docs">分享703507  703507  703507  我試圖在 laraval 5.8 中使用 php artisan migrate 命令更改我的 char 類型列默認(rèn)值,但出現(xiàn)以下錯(cuò)誤: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.我當(dāng)前的腳本如下: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) {        //    });}}我沒有遇到其他數(shù)據(jù)類型列的問題,但僅針對(duì) char 出現(xiàn)上述錯(cuò)誤。可以幫我解決這個(gè)問題嗎?PHP數(shù)據(jù)庫(kù)拉維laravel-5
查看完整描述

1 回答

?
白衣染霜花

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超10個(gè)贊

您需要在遷移腳本中添加以下腳本:

在 use Illuminate\Database\Migrations\Migration 下或之上添加以下內(nèi)容;

 use Doctrine\DBAL\Types\StringType; use Doctrine\DBAL\Types\Type;

之后在 inside up 函數(shù)中添加以下腳本并再次嘗試 php artisan migrate。

    if (!Type::hasType('char')) {
        Type::addType('char', StringType::class);
    }


查看完整回答
反對(duì) 回復(fù) 2023-03-11
  • 1 回答
  • 0 關(guān)注
  • 128 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)