我之前创建了USERS表.现在,我已经创建了一个新迁移,以便在我的模式中创建一个新的BOOKS表.当我try 运行该命令时
php artisan migrate
It shows:
[Illuminate\Database\QueryException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre
ady exists (SQL: create table `users` (`id` int unsigned not null auto_incr
ement primary key, `username` varchar(255) not null, `email` varchar(255) n
ot null, `password` varchar(255) not null, `created_at` timestamp default 0
not null, `updated_at` timestamp default 0 not null) default character set
utf8 collate utf8_unicode_ci)
Here is my new migration table:个
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBooksTable extends Migration {
public function up()
{
Schema::create('books', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('auther');
$table->string('area');
$table->timestamps();
});
}
public function down()
{
Schema::drop('books');
}
}
我怎样才能消除这个错误?