我是新手Laravel
,我正在关注Laravel Documentations
一些教程视频。但是,我php artisan migrate
在本地运行此代码,CMD prompt
而不是Database Table
在phpmyadmin
. 还有其他几个与此相关的类似主题,stackoverflow
但没有一个能解决我的问题。请不要标记此重复项。
好吧,事情是这样的。我运行这段代码
php artisan make:migration create_student_table --create=student
并且新文件在迁移文件夹中创建为2016_04_08_061507_create_student_table.php
然后在那个文件中我运行这个code
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudentTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('student', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('name', 20);
$table->string('email', 255);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('student');
}
}
然后在cmd
我运行php artisan migrate
但它没有创建student
表。相反,它显示此消息
[PDOException] SQLSTATE[42S01]:基表或视图已存在:1050 表“用户”已存在
users
几天前我使用与上述类似的方法创建了表格。但是student
没有创建新表。我在这里错过了什么吗?提前致谢。