0
我想建一個表,但是當我運行此命令「PHP工匠移民」這個錯誤發生:基表或視圖未找到:1146表「epharmacy.medicines」不存在
[照亮\數據庫\ QueryException]
SQLSTATE [42S02]:基表或視圖未找到:1146表 'epharmacy.medici
未列名' 不存在(SQL:改變表medicines
添加id
INT無符號不
空AUTO_INCREMENT主鍵,加name
varchar(255)不爲空,加typ
varchar(255)不爲空,加
epotency
varchar(255)not nul L,加created
時間戳空,加
_atupdated_at
時間戳空)
遷移:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMedicineTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('medicines', function (Blueprint $table) {
$table->increments('id');
$table->String('name');
$table->String('type');
$table->String('potency');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('medicines', function (Blueprint $table) {
//
});
}
}
變化類名createmedicinetable到criatemedicines表和嘗試 – ashanrupasinghe