I have created a Laravel project and I added few table with Migrate. It was working fine. The tables already had data. Now I require another table and I tried to add it with this command:
php artisan make:migration create_books_table
It is working and add files at \database\migrations.... I then added schema at up() function. But when I run the command,
php artisan migrate
It is not working , giving error Base table or view already exists.
Please help. I am very new to laravel. Thanks
Migration code..
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBooksTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('books', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->text('description');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('books');
}
}
books
table or view, right? Looks everything is fine.. – Doggy