Laravel Add New Migrating Table

I created a Laravel project and I added some tables using Migrate. It worked fine. The tables already had data. Now I need another table, and I tried to add it with this command:

php artisan make:migration create_books_table

It works and adds files to \ database \ migrations .... Then I added the schema to the up () function. But when I run the command,

php artisan migrate

It does not work, giving an error. A 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');
    }

}
+4
source share
2 answers

Laravel , . , , . , . , .

+2

"database/migrations/" "path" . .

php artisan migrate --path=/database/migrations/new folder/ 
0

All Articles