php artisan migrate,PHP artisan迁移不创建新表

我是Laravel的新手,我正在关注Laravel Documentations以及一些教程视频.但是,我在我的本地CMD提示符中运行这个php artisan迁移代码,而不是在phpmyadmin中创建数据库表.在stackoverflow中还有其他几个与此相关的类似主题,但没有解决我的问题.请不要标记此副本.

好吧,它是这样的.我运行这段代码

php artisan make:migration create_student_table --create=student

并在迁移文件夹中创建新文件,如2016_04_08_061507_create_student_table.php

然后在该文件中我运行此代码

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但它没有创建学生表.相反,它显示此消息

[PDOException] SQLSTATE[42S01]: Base table or view already exists:

1050 Table ‘users’ already exists

几天前我使用类似的方法创建了用户表.但是没有创建新的学生表.我在这里遗漏了什么?

提前致谢.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值